Exemple #1
0
 def testMakeSingleAttribRule(self):
     m = makeRule(['foo'])
     d = Dummy()
     d.foo = 0
     self.assertEqual(0,m(d))
     d.foo = 3
     self.assertEqual(3,m(d))
Exemple #2
0
 def testMakeMultiAttribRule(self):
     m = makeRule(['foo','bar'])
     d = Dummy()
     d.foo = 0
     self.assertEqual(0,m(d))
     d.foo = 3
     self.assertEqual(0,m(d))
     d.bar = 4
     self.assertEqual(12,m(d))