def test_return_true_if_all_utilities_returns_true(self): self.site_manager.registerUtility( DummyCheckerTrue(), IConstraintChecker, name=u'checker1: True') self.site_manager.registerUtility( DummyCheckerTrue(), IConstraintChecker, name=u'checker2: True') self.assertTrue(is_transition_allowed(object, "transition"))
def test_return_true_if_all_utilities_returns_true(self): self.site_manager.registerUtility(DummyCheckerTrue(), IConstraintChecker, name=u'checker1: True') self.site_manager.registerUtility(DummyCheckerTrue(), IConstraintChecker, name=u'checker2: True') self.assertTrue(is_transition_allowed(object, "transition"))
def test_return_false_if_at_least_one_utility_returns_false(self): self.site_manager.registerUtility( DummyCheckerTrue(), IConstraintChecker, name=u'checker1: True') self.site_manager.registerUtility( DummyCheckerFalse(), IConstraintChecker, name=u'checker2: False') self.site_manager.registerUtility( DummyCheckerTrue(), IConstraintChecker, name=u'checker3: True') self.assertFalse(is_transition_allowed(object, "transition"))
def test_return_false_if_at_least_one_utility_returns_false(self): self.site_manager.registerUtility(DummyCheckerTrue(), IConstraintChecker, name=u'checker1: True') self.site_manager.registerUtility(DummyCheckerFalse(), IConstraintChecker, name=u'checker2: False') self.site_manager.registerUtility(DummyCheckerTrue(), IConstraintChecker, name=u'checker3: True') self.assertFalse(is_transition_allowed(object, "transition"))
def test_return_true_if_no_utilities_are_registered(self): self.assertTrue(is_transition_allowed(object, "transition"))