def test_get_m49_from_iso3(self):
     assert Country.get_m49_from_iso3('AFG') == 4
     assert Country.get_m49_from_iso3('WSM') == 882
     assert Country.get_m49_from_iso3('TWN') == 158
     assert Country.get_m49_from_iso3('ABC') is None
     with pytest.raises(LocationError):
         Country.get_m49_from_iso3('ABC', exception=LocationError)
Beispiel #2
0
 def test_get_m49_from_iso3(self):
     assert Country.get_m49_from_iso3('AFG', use_live=False) == 4
     assert Country.get_m49_from_iso3('WSM', use_live=False) == 882
     assert Country.get_m49_from_iso3('TWN', use_live=False) is 158
     assert Country.get_m49_from_iso3('ABC', use_live=False) is None
     with pytest.raises(LocationError):
         Country.get_m49_from_iso3('ABC',
                                   use_live=False,
                                   exception=LocationError)
Beispiel #3
0
def get_country_url_string(country_list):
    return ':OR:iso='.join([
        str(Country.get_m49_from_iso3(Country.get_iso3_country_code(country)))
        for country in country_list
    ])