def testTzResNameFromString(self): tzr = tzwin.tzres() self.assertEqual(tzr.name_from_string("@tzres.dll,-221"), "Alaskan Daylight Time") self.assertEqual(tzr.name_from_string("Samoa Daylight Time"), "Samoa Daylight Time") with self.assertRaises(ValueError): tzr.name_from_string("@tzres.dll,100")
def testTzResNameFromString(self): tzr = tzwin.tzres() self.assertEqual(tzr.name_from_string('@tzres.dll,-221'), 'Alaskan Daylight Time') self.assertEqual(tzr.name_from_string('Samoa Daylight Time'), 'Samoa Daylight Time') with self.assertRaises(ValueError): tzr.name_from_string('@tzres.dll,100')
def testTzResLoadName(self): # This may not work right on non-US locales. tzr = tzwin.tzres() self.assertEqual(tzr.load_name(112), "Eastern Standard Time")