def test_papy_response_google_ok_but_no_wiki(): wiki_data = Wikipedia() maps_data = GoogleMaps() maps_data.return_value = Return.RETURN_OK ret = papy_response(maps_data, wiki_data) assert ret[1:] == (NO_WIKI, True, False) wiki_data.return_value = Return.NO_RETURN ret = papy_response(maps_data, wiki_data) assert ret[1:] == (NO_WIKI_INFO, True, False)
def test_papy_response_both_api_are_ok(): wiki_data = Wikipedia() maps_data = GoogleMaps() wiki_data.return_value = Return.RETURN_OK maps_data.return_value = Return.RETURN_OK wiki_data.blabla = 's<iuvhvuidshufhfuhquffvslsufguzeeh' maps_data.formatted_address = 'Paris, France' ret = papy_response(maps_data, wiki_data) assert maps_data.formatted_address in ret[0] assert wiki_data.blabla[:100] in ret[1] assert ret[2] assert ret[3]