def test_geonames_license_keys(self): license_keys = LicenseKeys() license_keys.add_key('GEO_NAMES_COUNTRY', "UK") license_keys.add_key('GEO_NAMES_ACCOUNTNAME', "TestAccount1") geonames = GeoNamesApi() geonames.check_for_license_keys(license_keys) self.assertEqual("UK", geonames.country) self.assertEqual("TestAccount1", geonames.account_name)
def test_geonames_no_country(self): license_keys = LicenseKeys() license_keys.add_key('GEO_NAMES_ACCOUNTNAME', "DummyValue") geonames = GeoNamesApi() with self.assertRaises(Exception): geonames.check_for_license_keys(license_keys)
def test_geonames_missing_license_keys(self): license_keys = LicenseKeys() geonames = GeoNamesApi() with self.assertRaises(Exception): geonames.check_for_license_keys(license_keys)