Beispiel #1
0
 def test_format_city(self):
     cases = [
         (("Chicago", "Ill."), "Chicago, IL"),
         (("Fargo", "ND"), "Fargo, ND"),
         (("Orlando", "Florida"), "Orlando, FL")
     ]
     for key, result in cases:
         self.assertEqual(City.format(*key), result)
Beispiel #2
0
 def test_longitude(self):
     cases = [
         ("There is no longitude in here", None),
         ("The longitude is 37.123°E", 37.123),
         ("This latitude 37.123°N won't match", None),
         ("45.678°W", -45.678),
     ]
     for key, result in cases:
         self.assertEqual(City.longitude(key), result)