Update of /cvsroot/python/python/nondist/sandbox/datetime In directory sc8-pr-cvs1:/tmp/cvs-serv5063 Modified Files: test_datetime.py Log Message: Added tests that conversion to our own timezone is always an identity, and that conversion to "timezone" None is the same as stripping the tzinfo member. Index: test_datetime.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/datetime/test_datetime.py,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** test_datetime.py 30 Dec 2002 17:05:15 -0000 1.86 --- test_datetime.py 30 Dec 2002 17:36:58 -0000 1.87 *************** *** 2607,2610 **** --- 2607,2617 ---- for during in dston, dston + delta, dstoff - delta: self.assertEqual(during.dst(), HOUR) + + # Conversion to our own timezone is always an identity. + self.assertEqual(during.astimezone(tz), during) + # Conversion to None is always the same as stripping tzinfo. + self.assertEqual(during.astimezone(None), + during.replace(tzinfo=None)) + asutc = during.astimezone(utc) there_and_back = asutc.astimezone(tz) *************** *** 2663,2666 **** --- 2670,2679 ---- there_and_back = outside.astimezone(utc).astimezone(tz) self.assertEqual(outside, there_and_back) + + # Conversion to our own timezone is always an identity. + self.assertEqual(outside.astimezone(tz), outside) + # Conversion to None is always the same as stripping tzinfo. + self.assertEqual(outside.astimezone(None), + outside.replace(tzinfo=None)) def test_easy(self):
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4