示例#1
0
 def test_compose_all_failing(self):
     attr_func_1 = attribute('a', equals(3, "is not 3"))
     attr_func_2 = attribute('b', equals(2, "is not 2"))
     f = compose(attr_func_1, attr_func_2)
     result = f(Obj(a=4, b=3))
     self.assertEqual(set(['is not 2', 'is not 3']), set(result))
示例#2
0
 def test_compose_one_failing(self):
     attr_func_1 = attribute('a', equals(3, "is not 3"))
     attr_func_2 = attribute('b', equals(2, "is not 2"))
     f = compose(attr_func_1, attr_func_2)
     result = f(Obj(a=3, b=3))
     self.assertEqual(['is not 2'], result)