[Zope3-checkins] CVS: Zope3/src/zope/app/tests - test_datetimeparse.py:1.1.2.2 test_standard_dates.py:1.1.2.2

Tim Peters tim.one@comcast.net
Mon, 23 Dec 2002 16:06:01 -0500


Update of /cvs-repository/Zope3/src/zope/app/tests
In directory cvs.zope.org:/tmp/cvs-serv7386/src/zope/app/tests

Modified Files:
      Tag: NameGeddon-branch
	test_datetimeparse.py test_standard_dates.py 
Log Message:
Renamed zope.app.datetime to zope.app.datetimeutils.  This tries to
import "the standard" datetime, but ended up thereby importing itself.


=== Zope3/src/zope/app/tests/test_datetimeparse.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/tests/test_datetimeparse.py:1.1.2.1	Mon Dec 23 14:32:32 2002
+++ Zope3/src/zope/app/tests/test_datetimeparse.py	Mon Dec 23 16:06:00 2002
@@ -12,12 +12,12 @@
 #
 ##############################################################################
 import unittest, sys
-from zope.app.datetime import parse, time, DateTimeError
+from zope.app.datetimeutils import parse, time, DateTimeError
 
 class Test(unittest.TestCase):
 
     def testParse(self):
-        from zope.app.datetime import parse
+        from zope.app.datetimeutils import parse
 
         self.assertEqual(parse('1999 12 31')[:6],
                          (1999, 12, 31, 0, 0, 0))
@@ -53,7 +53,7 @@
 
     def testTime(self):
         from time import gmtime
-        from zope.app.datetime import time
+        from zope.app.datetimeutils import time
         self.assertEqual(gmtime(time('1999 12 31 GMT'))[:6],
                          (1999, 12, 31, 0, 0, 0))
         self.assertEqual(gmtime(time('1999 12 31 EST'))[:6],
@@ -66,14 +66,14 @@
                          (1999, 12, 31, 0, 11, 22))
 
     def testBad(self):
-        from zope.app.datetime import time, DateTimeError
+        from zope.app.datetimeutils import time, DateTimeError
         self.assertRaises(DateTimeError, parse, '1999-31-12 1:2:63.456')
         self.assertRaises(DateTimeError, parse, '1999-31-13 1:2:3.456')
         self.assertRaises(DateTimeError, parse, '1999-2-30 1:2:3.456')
         self.assertRaises(DateTimeError, parse, 'April 31, 1999 1:2:3.456')
 
     def testLeap(self):
-        from zope.app.datetime import time, DateTimeError
+        from zope.app.datetimeutils import time, DateTimeError
         self.assertRaises(DateTimeError, parse, '1999-2-29 1:2:3.456')
         self.assertRaises(DateTimeError, parse, '1900-2-29 1:2:3.456')
         self.assertEqual(parse('2000-02-29 1:2:3')[:6],
@@ -82,7 +82,7 @@
                          (2004, 2, 29, 1, 2, 3))
 
     def test_tzoffset(self):
-        from zope.app.datetime import _tzoffset
+        from zope.app.datetimeutils import _tzoffset
         self.assertEqual(_tzoffset('-0400', None), -4*60*60)
         self.assertEqual(_tzoffset('-0030', None), -30*60)
         self.assertEqual(_tzoffset('+0200', None), 2*60*60)
@@ -90,7 +90,7 @@
 
     def testParseDatetimetz(self):
         from datetime import datetimetz
-        from zope.app.datetime import parseDatetimetz, tzinfo
+        from zope.app.datetimeutils import parseDatetimetz, tzinfo
         self.assertEqual(parseDatetimetz('1999-12-31T01:02:03.037-00:30'),
                          datetimetz(1999, 12, 31, 1, 2, 3, 37000, tzinfo(-30)))
 


=== Zope3/src/zope/app/tests/test_standard_dates.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/tests/test_standard_dates.py:1.1.2.1	Mon Dec 23 14:32:32 2002
+++ Zope3/src/zope/app/tests/test_standard_dates.py	Mon Dec 23 16:06:00 2002
@@ -11,24 +11,24 @@
 # FOR A PARTICULAR PURPOSE.
 # 
 ##############################################################################
-import unittest, sys, time
+import unittest
 
-from zope.app.datetime import time
+from zope.app.datetimeutils import time
 
 class Test(unittest.TestCase):
 
     def testiso8601_date(self):
-        from zope.app.datetime import iso8601_date
+        from zope.app.datetimeutils import iso8601_date
         self.assertEqual(iso8601_date(time("2000-01-01T01:01:01.234Z")),
                          "2000-01-01T01:01:01Z")
 
     def testrfc850_date(self):
-        from zope.app.datetime import rfc850_date
+        from zope.app.datetimeutils import rfc850_date
         self.assertEqual(rfc850_date(time("2002-01-12T01:01:01.234Z")),
                          "Saturday, 12-Jan-02 01:01:01 GMT")
 
     def testrfc1123_date(self):
-        from zope.app.datetime import rfc1123_date
+        from zope.app.datetimeutils import rfc1123_date
         self.assertEqual(rfc1123_date(time("2002-01-12T01:01:01.234Z")),
                          "Sat, 12 Jan 2002 01:01:01 GMT")