def testMakeSingleAttribRule(self): m = makeRule(['foo']) d = Dummy() d.foo = 0 self.assertEqual(0,m(d)) d.foo = 3 self.assertEqual(3,m(d))
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))