def test_no_method(self): # An object without the method is ignored. self.objects.append(self.make_object('Obj3', has_method=False)) backend.call_methods(self.objects, 'method') expected = [['Obj1', ()], ['Obj2', ()]] self.assertEqual(expected, self.called)
def test_call(self): # The methods are correctly called. backend.call_methods(self.objects, 'method', 'arg1', 'arg2') expected = [['Obj1', ('arg1', 'arg2')], ['Obj2', ('arg1', 'arg2')]] self.assertEqual(expected, self.called)
def test_no_method(self): # An object without the method is ignored. self.objects.append(self.make_object("Obj3", has_method=False)) backend.call_methods(self.objects, "method") expected = [["Obj1", ()], ["Obj2", ()]] self.assertEqual(expected, self.called)
def test_call(self): # The methods are correctly called. backend.call_methods(self.objects, "method", "arg1", "arg2") expected = [["Obj1", ("arg1", "arg2")], ["Obj2", ("arg1", "arg2")]] self.assertEqual(expected, self.called)