Base run_street_point_geocoder test

This commit is contained in:
Juan Ignacio Sánchez Lara 2018-07-19 21:08:07 +02:00
parent 0d490bbb19
commit 96fbf3080a

View File

@ -0,0 +1,29 @@
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
from unittest import TestCase
from mock import Mock, MagicMock
from nose.tools import assert_not_equal, assert_equal, assert_true
from cartodb_services.geocoder import run_street_point_geocoder
class TestRunStreetPointGeocoder(TestCase):
def test_count_increment_total_service_use_on_error(self):
quota_service_mock = Mock()
service_manager_mock = Mock()
service_manager_mock.quota_service = quota_service_mock
searches = []
logger_config_mock = MagicMock(min_log_level='debug',
log_file_path='/tmp/ptest.log')
with(self.assertRaises(BaseException)):
run_street_point_geocoder(Mock(),
{'logger_config': logger_config_mock},
None,
service_manager_mock,
None, None, searches)
quota_service_mock.increment_total_service_use. \
assert_called_once_with()