You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/05/14 22:13:13 UTC

svn commit: r1482554 - /subversion/trunk/subversion/bindings/ctypes-python/test/svntypes.py

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):



Re: svn commit: r1482554 - /subversion/trunk/subversion/bindings/ctypes-python/test/svntypes.py

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 05/14/2013 04:13 PM, breser@apache.org wrote:
> 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.

Awesome!  I had pushed this buglet onto my TODO list at the end of last
week.  This one test was the only ctypes-python test failing for me (after
getting them to build and test at all!).

I expect it will still fail for me as I test rc2, but that (alone) won't
prevent my +1.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Enterprise Cloud Development