PS: the mock code isn't mine and I failed to credit the original author in my repository, so here it is for now: http://stackoverflow.com/a/23573376/1640404. I'll add the link in a future commit.
On 7 September 2016 at 17:13, Christopher Crouzet < [email protected]> wrote: > Marcus: I have no idea what this MetaData implementation refers to? > > Cesar: True but I personally like avoiding unnecessary external > dependencies for such simple needs (the module `mock` is not part of > `mayapy` which is Python 2). Otherwise it feels like coding in JavaScript > using one line NPM modules such as https://github.com/kevva/is-positive > :) To each its own. > > > On 7 September 2016 at 17:01, Cesar Saez <[email protected]> wrote: > >> No need to reinvent the wheel, there's a std/production proved mock >> module! (it's part of python3 std Library iirc). >> >> pip install mock >> >> You basically replace Maya entries on sys.modules by a MagicMock instance >> (check the docs for more info, there are convenience functions to do it and >> everything... mocking dependencies is a very common practice and is well >> documented). >> >> Hope this helps, >> Cheers >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Python Programming for Autodesk Maya" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/python_inside_maya/CAPamJi-ARG9Amp3twfCcPY8m-%3DBw- >> HQpfZuZ1TTtnLitJsV-6A%40mail.gmail.com >> <https://groups.google.com/d/msgid/python_inside_maya/CAPamJi-ARG9Amp3twfCcPY8m-%3DBw-HQpfZuZ1TTtnLitJsV-6A%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Christopher Crouzet > *http://christophercrouzet.com* <http://christophercrouzet.com> > > -- Christopher Crouzet *http://christophercrouzet.com* <http://christophercrouzet.com> -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CANuKW51ean%3DeKNFf-XvQ2zZU1Cf4uUW-g8RPbsCbky50TeGtCg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
