Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def check_requirements(self, obj, source, **expected_versions):
compare(C(Requirements,
versions=expected_versions,
source=source,
strict=False),
obj)
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)
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)
def __init__(self, *expected, **filters):
super(ShouldWarn, self).__init__(record=True)
self.expected = [C(e) for e in expected]
self.filters = filters
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)
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'])