def assert_called(self, method, url, body=None):
        expected = (method, url)
        called = self.client.callstack[-1][0:2]

        assert self.client.callstack, "Expected %s %s but no calls were made." % expected

        assert expected == called, 'Expected %s %s; got %s %s' % (expected + called)

        if body is not None:
            assert_equal(self.client.callstack[-1][2], body)

        self.client.callstack = []
Assert than an API method was just called.
dataset/ETHPy150Open jacobian-archive/openstack.compute/tests/fakeserver.py/FakeServer.assert_called