Python test doubles
Project description
Powerful test doubles framework for Python.
design principles
doubles should not have public API framework methods. It avoids silent misspelling.
doubles do not require collaborator instances, just classes, and it never instantiate them.
assert_that() is used for ALL assertions.
invocation order for mocks is relevant by default.
supports old and new style classes.
a trivial example
import unittest
from doublex import Spy, assert_that, called
class SpyUseExample(unittest.TestCase):
def test_spy_example(self):
# given
spy = Spy(SomeCollaboratorClass)
cut = YourClassUnderTest(spy)
# when
cut.a_method_that_call_the_collaborator()
# then
assert_that(spy.some_method, called())
See more about doublex doubles.
relevant links
Debian
official package (may be outdated)
amateur repository: deb http://babel.esi.uclm.es/arco/ sid main (always updated)
debian dir: svn://svn.debian.org/svn/python-modules/packages/doublex/trunk
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
doublex-1.8.1.tar.gz
(34.8 kB
view hashes)