@mock.patch(REQUESTS)
def test_error_returned_if_no_match(self, mocked_request):
    mocked_response = mock.Mock()
    mocked_response.json.return_value = []
    mocked_request.return_value = mocked_response
    with pytest.raises(ValueError) as e:
        geocode(q='Something bad')
    assert ('No geocode match' in str(e.value))
@mock.patch(REQUESTS)
def test_error_returned_if_no_match(self, mocked_request):
    mocked_response = mock.Mock()
    mocked_response.json.return_value = []
    mocked_request.return_value = mocked_response
    with pytest.raises(ValueError) as e:
        geocode(q='Something bad')
    assert ('No geocode match' in str(e.value))