Skip to content

tecnologiaenegocios/stubydoo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stubydoo

A mock/stub library for Python 2.x

Disclaimer

This package is considered unstable. API changes may happen without notice. Not ready for public comsumption. Suggestions on how the API could be improved are welcome, as well as code contributions (with tests) ;)

Usage example

This package provides a basic mocking/stubbing functionality for use in test code. It's possible to change the behavior of a method of any non-builtin object:

>>> from stubydoo import stub
>>> class MyObject(object):
...     def get_foo(self):
...         return 'foo'
>>> my_object = MyObject()
>>> _ = stub(my_object.get_foo).and_return('bar')
>>> my_object.get_foo()
'bar'

About

A mock/stub library for Python 2.x

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages