Пример #1
0
    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"))
Пример #2
0
    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"))
Пример #3
0
    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"))
Пример #4
0
    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"))
Пример #5
0
 def test_return_true_if_no_utilities_are_registered(self):
     self.assertTrue(is_transition_allowed(object, "transition"))
Пример #6
0
 def test_return_true_if_no_utilities_are_registered(self):
     self.assertTrue(is_transition_allowed(object, "transition"))