Esempio n. 1
0
 def test_newark(self):
     weatherservice._USE_CLASSES = False
     report = weatherservice.get_report("newark, de")
     self.assertIsInstance(report, dict)
Esempio n. 2
0
 def test_china(self):
     with self.assertRaises(weatherservice.GeocodeException):
         weatherservice.get_report("tokoyo, china")
Esempio n. 3
0
 def test_cache(self):
     weatherservice._start_editing()
     weatherservice.get_report("newark, de")
     weatherservice.get_report("blacksburg, va")
     weatherservice.get_report("new york, NY")
     weatherservice.get_report("santa barbara, CA")
     weatherservice.get_report("san francisco, CA")
     self.assertEqual(len(weatherservice._CACHE), 27)
     weatherservice.get_report("san francisco, CA")
     weatherservice.get_report("san francisco, CA")
     weatherservice.get_report("san francisco, CA")
     self.assertEqual(sum([len(element) for key, element in weatherservice._CACHE.items()]), 67)
Esempio n. 4
0
 def test_newark(self):
     weatherservice._USE_CLASSES = False
     report = weatherservice.get_report("newark, de")
     self.assertIsInstance(report, dict)
Esempio n. 5
0
 def test_china(self):
     with self.assertRaises(weatherservice.GeocodeException):
         weatherservice.get_report("tokoyo, china")
Esempio n. 6
0
 def test_cache(self):
     weatherservice._start_editing()
     weatherservice.get_report("newark, de")
     weatherservice.get_report("blacksburg, va")
     weatherservice.get_report("new york, NY")
     weatherservice.get_report("santa barbara, CA")
     weatherservice.get_report("san francisco, CA")
     self.assertEqual(len(weatherservice._CACHE), 27)
     weatherservice.get_report("san francisco, CA")
     weatherservice.get_report("san francisco, CA")
     weatherservice.get_report("san francisco, CA")
     self.assertEqual(
         sum([
             len(element) for key, element in weatherservice._CACHE.items()
         ]), 67)