def assert_called(_mock_self):
    """assert that the mock was called at least once."""
    self = _mock_self
    if self.call_count == 0:
        msg = "Expected '%s' to have been called." % self._mock_name or 'mock'
        raise AssertionError(msg)
