subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1482554 - /subversion/trunk/subversion/bindings/ctypes-python/test/svntypes.py
Date Tue, 14 May 2013 20:13:13 GMT
Author: breser
Date: Tue May 14 20:13:13 2013
New Revision: 1482554

URL: http://svn.apache.org/r1482554
Log:
Make ctypes-python tests pass regardless of timezone.

SvnDate.as_human_string() calls svn_time_to_human_cstring() which provides the
date as a string in the local timezone.  The test was hardcoded to assume the
local timezone was UTC.  Making an exact match against the string would
essentially require a reimplementation of the C function, so just use a regexp
to match that we're getting something in the right format.

* subversion/bindings/ctypes-python/test/svntypes.py
  (test_as_human_string): Use a regexp to validate the function works.

Modified:
    subversion/trunk/subversion/bindings/ctypes-python/test/svntypes.py

Modified: subversion/trunk/subversion/bindings/ctypes-python/test/svntypes.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/ctypes-python/test/svntypes.py?rev=1482554&r1=1482553&r2=1482554&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/ctypes-python/test/svntypes.py (original)
+++ subversion/trunk/subversion/bindings/ctypes-python/test/svntypes.py Tue May 14 20:13:13
2013
@@ -35,7 +35,8 @@ class SvnDateTestCase(unittest.TestCase)
     def test_as_human_string(self):
         d1 = SvnDate('1999-12-31T23:59:59.000000Z')
         s1 = d1.as_human_string()
-        self.assertEqual(s1[:27], '1999-12-31 23:59:59 +0000 (')
+        self.assertRegexpMatches(s1[:27],
+            '\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} [+-]\d{4} \(')
 
 
 class HashTestCase(unittest.TestCase):



Mime
View raw message