mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-05-22 21:46:17 +03:00
Revert the api_client miniapp accidental changes
This commit is contained in:
parent
083c050cd4
commit
5a4edd65b8
|
@ -7,7 +7,7 @@ import models
|
||||||
|
|
||||||
|
|
||||||
# Creating ApiClient and User providers:
|
# Creating ApiClient and User providers:
|
||||||
api_client = providers.Singleton(api.Converter,
|
api_client = providers.Singleton(api.ApiClient,
|
||||||
host='production.com',
|
host='production.com',
|
||||||
api_key='PROD_API_KEY')
|
api_key='PROD_API_KEY')
|
||||||
user_factory = providers.Factory(models.User,
|
user_factory = providers.Factory(models.User,
|
||||||
|
@ -27,7 +27,7 @@ if __name__ == '__main__':
|
||||||
# {'id': 2}
|
# {'id': 2}
|
||||||
|
|
||||||
# Overriding of ApiClient on dev environment:
|
# Overriding of ApiClient on dev environment:
|
||||||
api_client.override(providers.Singleton(api.Converter,
|
api_client.override(providers.Singleton(api.ApiClient,
|
||||||
host='localhost',
|
host='localhost',
|
||||||
api_key='DEV_API_KEY'))
|
api_key='DEV_API_KEY'))
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import main
|
||||||
import api
|
import api
|
||||||
|
|
||||||
# Mock ApiClient for testing:
|
# Mock ApiClient for testing:
|
||||||
with main.api_client.override(Mock(api.Converter)) as api_client_mock:
|
with main.api_client.override(Mock(api.ApiClient)) as api_client_mock:
|
||||||
user = main.user_factory('test')
|
user = main.user_factory('test')
|
||||||
user.register()
|
user.register()
|
||||||
api_client_mock().call.assert_called_with('register', {'id': 'test'})
|
api_client_mock().call.assert_called_with('register', {'id': 'test'})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user