def test_execute(self): func = mock.Mock() deferred = placement_report.DeferredCall( func, 'some arg', kwarg='some kwarg') deferred.execute() func.assert_called_once_with('some arg', kwarg='some kwarg')
def test___str__(self): def func(): pass deferred = placement_report.DeferredCall(func, 42, foo='bar') self.assertEqual("func(42, foo='bar')", str(deferred))
def test_defer_not_called(self): func = mock.Mock() placement_report.DeferredCall(func) func.assert_not_called()