def test_most_specific_interface_wins(self): from z3c.caching.registry import register, lookup register(ITestView, "frop") register(IMoreSpecificTestView, "fribble") i=OtherTestView() self.assertEqual(lookup(i), "fribble")
def test_unregistering_ruleset_removes_ruleset(self): from z3c.caching.registry import register, unregister, lookup register(TestView, "frop") unregister(TestView) self.failUnless(lookup(TestView) is None)
def test_ruleset_for_interface(self): from z3c.caching.registry import register, lookup register(ITestView, "frop") i=TestView() self.assertEqual(lookup(i), "frop")
def test_most_specific_interface_wins(self): from z3c.caching.registry import register, lookup register(ITestView, "frop") register(IMoreSpecificTestView, "fribble") i = OtherTestView() self.assertEqual(lookup(i), "fribble")
def test_ruleset_for_interface(self): from z3c.caching.registry import register, lookup register(ITestView, "frop") i = TestView() self.assertEqual(lookup(i), "frop")
def test_register(self): from z3c.caching.registry import register with self.assertRaises(LookupError): register(TestView, 'testrule')