In case of general error, failed service use should be incremented by searches length
This commit is contained in:
@@ -8,11 +8,13 @@ from cartodb_services.geocoder import run_street_point_geocoder
|
||||
|
||||
|
||||
class TestRunStreetPointGeocoder(TestCase):
|
||||
def test_count_increment_total_service_use_on_error(self):
|
||||
def test_count_increment_total_and_failed_service_use_on_error(self):
|
||||
quota_service_mock = Mock()
|
||||
|
||||
service_manager_mock = Mock()
|
||||
service_manager_mock.quota_service = quota_service_mock
|
||||
service_manager_mock.assert_within_limits = \
|
||||
Mock(side_effect=Exception('Fail!'))
|
||||
|
||||
searches = []
|
||||
|
||||
@@ -27,3 +29,6 @@ class TestRunStreetPointGeocoder(TestCase):
|
||||
|
||||
quota_service_mock.increment_total_service_use. \
|
||||
assert_called_once_with(len(searches))
|
||||
|
||||
quota_service_mock.increment_failed_service_use. \
|
||||
assert_called_once_with(len(searches))
|
||||
|
||||
Reference in New Issue
Block a user