Пример #1
0
 def test_init_with_license_keys(self):
     met_office = MetOffice()
     self.assertIsNotNone(met_office)
     license_keys = LicenseKeys()
     license_keys.add_key('METOFFICE_API_KEY', "ABCDEFGHIJKL")
     met_office.check_for_license_keys(license_keys)
     self.assertIsNotNone(met_office._met_office_api)
Пример #2
0
 def test_init_no_license_keys(self):
     self._client.license_keys.empty()
     with self.assertRaises(Exception):
         met_office = MetOffice()
         met_office.check_for_license_keys(None)
Пример #3
0
 def test_init_with_license_keys_none_present(self):
     met_office = MetOffice()
     self.assertIsNotNone(met_office)
     license_keys = LicenseKeys()
     with self.assertRaises(Exception):
         met_office.check_for_license_keys(license_keys)