@mock.patch(_GEOCODE)
def test_duplicates_are_only_geocoded_once(self, mocked_geocode):
    test_dataframe = pd.DataFrame({'index': [0, 1, 2, 3], 'city': ['London', 'Brussels', 'London', 'Brussels'], 'country': ['UK', 'Belgium', 'UK', 'Belgium']})
    mocked_geocode.side_effect = ['LON', 'BRU']
    geocoded_dataframe = geocode_dataframe(test_dataframe)
    expected_dataframe = pd.DataFrame({'index': [0, 1, 2, 3], 'city': ['London', 'Brussels', 'London', 'Brussels'], 'country': ['UK', 'Belgium', 'UK', 'Belgium'], 'coordinates': ['LON', 'BRU', 'LON', 'BRU']})
    assert (geocoded_dataframe.to_dict(orient='records') == expected_dataframe.to_dict(orient='records'))
    assert (mocked_geocode.call_count == 2)
@mock.patch(_GEOCODE)
def test_duplicates_are_only_geocoded_once(self, mocked_geocode):
    test_dataframe = pd.DataFrame({'index': [0, 1, 2, 3], 'city': ['London', 'Brussels', 'London', 'Brussels'], 'country': ['UK', 'Belgium', 'UK', 'Belgium']})
    mocked_geocode.side_effect = ['LON', 'BRU']
    geocoded_dataframe = geocode_dataframe(test_dataframe)
    expected_dataframe = pd.DataFrame({'index': [0, 1, 2, 3], 'city': ['London', 'Brussels', 'London', 'Brussels'], 'country': ['UK', 'Belgium', 'UK', 'Belgium'], 'coordinates': ['LON', 'BRU', 'LON', 'BRU']})
    assert (geocoded_dataframe.to_dict(orient='records') == expected_dataframe.to_dict(orient='records'))
    assert (mocked_geocode.call_count == 2)