[Python-checkins] python/nondist/sandbox/datetime test_datetime.py,1.101,1.102

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
2003年1月22日 12:49:25 -0800


Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory sc8-pr-cvs1:/tmp/cvs-serv23607
Modified Files:
	test_datetime.py 
Log Message:
Ensure astimezone() calls user-defined fromutc() (if any).
Index: test_datetime.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/test_datetime.py,v
retrieving revision 1.101
retrieving revision 1.102
diff -C2 -d -r1.101 -r1.102
*** test_datetime.py	22 Jan 2003 20:22:24 -0000	1.101
--- test_datetime.py	22 Jan 2003 20:49:21 -0000	1.102
***************
*** 2833,2836 ****
--- 2833,2840 ----
 self.assertEqual(expected, got)
 
+ # Ensure astimezone() calls fromutc() too.
+ got = fstart.replace(tzinfo=utc_real).astimezone(FEastern)
+ self.assertEqual(expected, got)
+ 
 start += HOUR
 fstart += HOUR
***************
*** 2846,2849 ****
--- 2850,2857 ----
 expected = fstart + FEastern.stdoffset
 got = FEastern.fromutc(fstart)
+ self.assertEqual(expected, got)
+ 
+ # Ensure astimezone() calls fromutc() too.
+ got = fstart.replace(tzinfo=utc_real).astimezone(FEastern)
 self.assertEqual(expected, got)
 

AltStyle によって変換されたページ (->オリジナル) /