python-dependency-injector/examples/miniapps/api_client/tests.py

13 lines
309 B
Python
Raw Normal View History

"""Tests module."""
2016-04-20 14:19:54 +03:00
from unittest.mock import Mock
2016-04-20 14:19:54 +03:00
import main
import api
# Mock ApiClient for testing:
with main.api_client.override(Mock(api.ApiClient)) as api_client_mock:
user = main.user_factory('test')
user.register()
api_client_mock().call.assert_called_with('register', {'id': 'test'})