def test_generate(self): try: self.assertDictEqual(generate_map(), CLDR_TO_MS_TIMEZONE_MAP) except CONNECTION_ERRORS: # generate_map() requires access to unicode.org, which may be unavailable. Don't fail test, since this is # out of our control. pass
def test_generate(self): try: version, tz_map = generate_map() except CONNECTION_ERRORS: # generate_map() requires access to unicode.org, which may be unavailable. Don't fail test, since this is # out of our control. return self.assertEqual(version, CLDR_WINZONE_VERSION) self.assertDictEqual(tz_map, CLDR_TO_MS_TIMEZONE_MAP)
def test_generate_failure(self, m): m.get(CLDR_WINZONE_URL, status_code=500) with self.assertRaises(ValueError): generate_map()