瀏覽代碼

Fixes test failures. Closes #551

Ask Solem 13 年之前
父節點
當前提交
cf12227c4f
共有 2 個文件被更改,包括 10 次插入10 次删除
  1. 4 4
      celery/tests/test_bin/test_celeryd.py
  2. 6 6
      celery/tests/test_utils/test_utils_timeutils.py

+ 4 - 4
celery/tests/test_bin/test_celeryd.py

@@ -253,19 +253,19 @@ class test_Worker(AppCase):
             raise SkipTest("Not applicable on Windows")
         warnings.resetwarnings()
 
-        def geteuid():
+        def getuid():
             return 0
 
-        prev, os.geteuid = os.geteuid, geteuid
+        prev, os.getuid = os.getuid, getuid
         try:
             with catch_warnings(record=True) as log:
                 worker = self.Worker()
                 worker.run()
                 self.assertTrue(log)
-                self.assertIn("superuser privileges is not encouraged",
+                self.assertIn("superuser privileges is discouraged",
                               log[0].message.args[0])
         finally:
-            os.geteuid = prev
+            os.getuid = prev
 
     @disable_stdouts
     def test_use_pidfile(self):

+ 6 - 6
celery/tests/test_utils/test_utils_timeutils.py

@@ -33,12 +33,12 @@ class test_timeutils(unittest.TestCase):
         self.assertEqual(timeutils.timedelta_seconds(delta), 0)
 
     def test_humanize_seconds(self):
-        t = ((4 * 60 * 60 * 24, "4 days"),
-             (1 * 60 * 60 * 24, "1 day"),
-             (4 * 60 * 60, "4 hours"),
-             (1 * 60 * 60, "1 hour"),
-             (4 * 60, "4 minutes"),
-             (1 * 60, "1 minute"),
+        t = ((4 * 60 * 60 * 24, "4.00 days"),
+             (1 * 60 * 60 * 24, "1.00 day"),
+             (4 * 60 * 60, "4.00 hours"),
+             (1 * 60 * 60, "1.00 hour"),
+             (4 * 60, "4.00 minutes"),
+             (1 * 60, "1.00 minute"),
              (4, "4.00 seconds"),
              (1, "1.00 second"),
              (4.3567631221, "4.36 seconds"),