[Checkins] SVN: zope.i18n/trunk/ Fixed a test failure in the compile mo file support.

Hanno Schlichting plone at hannosch.info
Mon Oct 13 15:33:39 EDT 2008


Log message for revision 92152:
  Fixed a test failure in the compile mo file support.
  

Changed:
  U   zope.i18n/trunk/CHANGES.txt
  U   zope.i18n/trunk/src/zope/i18n/tests/test_zcml.py

-=-
Modified: zope.i18n/trunk/CHANGES.txt
===================================================================
--- zope.i18n/trunk/CHANGES.txt	2008-10-13 19:28:34 UTC (rev 92151)
+++ zope.i18n/trunk/CHANGES.txt	2008-10-13 19:33:38 UTC (rev 92152)
@@ -5,6 +5,9 @@
 3.6.0 (unreleased)
 ------------------
 
+- Fixed a test failure in the compile mo file support.
+  [hannosch]
+
 - Move the zcml support into an extra. This reduces the dependencies of a
   standard zope.i18n install by half a dozen packages.
 

Modified: zope.i18n/trunk/src/zope/i18n/tests/test_zcml.py
===================================================================
--- zope.i18n/trunk/src/zope/i18n/tests/test_zcml.py	2008-10-13 19:28:34 UTC (rev 92151)
+++ zope.i18n/trunk/src/zope/i18n/tests/test_zcml.py	2008-10-13 19:33:38 UTC (rev 92152)
@@ -17,6 +17,7 @@
 """
 import os
 import shutil
+import stat
 import unittest
 
 from zope.component import getUtility
@@ -127,6 +128,12 @@
         path = os.path.join(basepath, 'zope-i18n.mo')
         shutil.copy2(in_, path)
 
+        # Make sure the older mo file always has an older time stamp
+        # than the po file
+        path_atime = os.stat(path)[stat.ST_ATIME]
+        path_mtime = os.stat(path)[stat.ST_MTIME]
+        os.utime(path, (path_atime, path_mtime - 6000))
+
         xmlconfig.string(
             template % '''
             <configure package="zope.i18n.tests">
@@ -144,6 +151,9 @@
         msg = util.translate(u"I'm a new file", target_language='en')
         self.assertEquals(msg, u"I'm a new file translated")
 
+        # Reset the mtime of the mo file
+        os.utime(path, (path_atime, path_mtime))
 
+
 def test_suite():
     return unittest.makeSuite(DirectivesTest)



More information about the Checkins mailing list