mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-17 21:19:38 -04:00
blunt rename of org (#620)
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
from app.notify_client.status_api_client import StatusApiClient
|
||||
|
||||
|
||||
def test_get_count_of_live_services_and_organisations(mocker):
|
||||
def test_get_count_of_live_services_and_organizations(mocker):
|
||||
mocker.patch('app.extensions.RedisClient.get', return_value=None)
|
||||
client = StatusApiClient()
|
||||
mock = mocker.patch.object(client, 'get', return_value={})
|
||||
|
||||
client.get_count_of_live_services_and_organisations()
|
||||
client.get_count_of_live_services_and_organizations()
|
||||
|
||||
mock.assert_called_once_with(url='/_status/live-service-and-organisation-counts')
|
||||
mock.assert_called_once_with(url='/_status/live-service-and-organization-counts')
|
||||
|
||||
|
||||
def test_sets_value_in_cache(mocker):
|
||||
@@ -26,12 +26,12 @@ def test_sets_value_in_cache(mocker):
|
||||
'app.extensions.RedisClient.set',
|
||||
)
|
||||
|
||||
assert client.get_count_of_live_services_and_organisations() == {'data_from': 'api'}
|
||||
assert client.get_count_of_live_services_and_organizations() == {'data_from': 'api'}
|
||||
|
||||
mock_redis_get.assert_called_once_with('live-service-and-organisation-counts')
|
||||
mock_api_get.assert_called_once_with(url='/_status/live-service-and-organisation-counts')
|
||||
mock_redis_get.assert_called_once_with('live-service-and-organization-counts')
|
||||
mock_api_get.assert_called_once_with(url='/_status/live-service-and-organization-counts')
|
||||
mock_redis_set.assert_called_once_with(
|
||||
'live-service-and-organisation-counts',
|
||||
'live-service-and-organization-counts',
|
||||
'{"data_from": "api"}',
|
||||
ex=3600
|
||||
)
|
||||
@@ -51,9 +51,9 @@ def test_returns_value_from_cache(mocker):
|
||||
'app.extensions.RedisClient.set',
|
||||
)
|
||||
|
||||
assert client.get_count_of_live_services_and_organisations() == {'data_from': 'cache'}
|
||||
assert client.get_count_of_live_services_and_organizations() == {'data_from': 'cache'}
|
||||
|
||||
mock_redis_get.assert_called_once_with('live-service-and-organisation-counts')
|
||||
mock_redis_get.assert_called_once_with('live-service-and-organization-counts')
|
||||
|
||||
assert mock_api_get.called is False
|
||||
assert mock_redis_set.called is False
|
||||
|
||||
Reference in New Issue
Block a user