How to use the testfixtures.Comparison function in testfixtures

To help you get started, we’ve selected a few testfixtures examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Simplistix / picky-conda / tests / test_handlers.py View on Github external
def check_requirements(self, obj, source, **expected_versions):
        compare(C(Requirements,
                  versions=expected_versions,
                  source=source,
                  strict=False),
                obj)
github Yelp / pgctl / tests / spec / slow_startup.py View on Github external
def it_becomes_unready():
        from testfixtures import Comparison as C
        from pgctl.daemontools import svstat
        assert svstat('playground/slow-startup') != C(SvStat, {'state': 'ready'}, strict=False)
github drillbits / pycure / tests / test_precure.py View on Github external
def test_now(self):
        dct = self._getTarget()
        from pycure.precure import Series
        dct['test'] = Series('test', 'テスキュア', date(2014, 5, 23), None,
                             True)
        now = self._callFUT(dct)

        from pycure.precure import Series
        compare(C(
            Series,
            strict=False,
            slug='test',
            title='テスキュア',
            broadcast_from=date(2014, 5, 23),
            broadcast_to=None,
            now=True), now)
github Simplistix / testfixtures / testfixtures / shouldwarn.py View on Github external
def __init__(self, *expected, **filters):
        super(ShouldWarn, self).__init__(record=True)
        self.expected = [C(e) for e in expected]
        self.filters = filters
github Yelp / pgctl / tests / testing / assertions.py View on Github external
def assert_svstat(service, **attrs):
    from testfixtures import Comparison as C
    from pgctl.daemontools import svstat, SvStat
    assert svstat(service) == C(SvStat, attrs, strict=False)
github drillbits / pycure / tests / test_precure.py View on Github external
def test_add(self):
        dct = self._getTarget()
        self._callFUT(dct, 'test', 'テスキュア', date(2014, 5, 23), None, True)

        from pycure.precure import Series
        compare(C(
            Series,
            strict=False,
            slug='test',
            title='テスキュア',
            broadcast_from=date(2014, 5, 23),
            broadcast_to=None,
            now=True), dct['test'])