def test_request_call(): with patch.object(requests, 'get') as mock_get: with patch.object(img, 'imread') as mock_img: # Ensure Map class does not try and create pixel map from mock sample_map = Greengraph(sample_start, sample_end, sample_delay) test_place = Map(*sample_map.geolocate(sample_start)) print mock_get.mock_calls mock_get.assert_called_with('http://maps.googleapis.com/maps/api/staticmap?',params = url)
def test_request_call(): with patch.object(requests, 'get') as mock_get: with patch.object( img, 'imread' ) as mock_img: # Ensure Map class does not try and create pixel map from mock sample_map = Greengraph(sample_start, sample_end, sample_delay) test_place = Map(*sample_map.geolocate(sample_start)) print mock_get.mock_calls mock_get.assert_called_with( 'http://maps.googleapis.com/maps/api/staticmap?', params=url)
def test_geolocate(): with patch.object(geocoders, 'GoogleV3') as mock_get: mymap = Greengraph(sample_start, sample_end, sample_delay) mymap.geolocate(sample_start) print mock_get.mock_calls mock_get.assert_called_with(domain='maps.google.co.uk')