Ejemplo n.º 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"))
Ejemplo n.º 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"))
Ejemplo n.º 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"))
Ejemplo n.º 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"))
Ejemplo n.º 5
0
 def test_return_true_if_no_utilities_are_registered(self):
     self.assertTrue(is_transition_allowed(object, "transition"))
Ejemplo n.º 6
0
 def test_return_true_if_no_utilities_are_registered(self):
     self.assertTrue(is_transition_allowed(object, "transition"))