Rev 4136: (vila) Fix fragile test in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Mar 12 14:38:29 GMT 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4136
revision-id: pqm at pqm.ubuntu.com-20090312143823-ypjpf0uqdrd17i9b
parent: pqm at pqm.ubuntu.com-20090312134315-vcpiopkmky1ch5s0
parent: v.ladeuil+lp at free.fr-20090312132005-cdcrdk8ps85c17o2
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2009-03-12 14:38:23 +0000
message:
  (vila) Fix fragile test
modified:
  bzrlib/tests/test_osutils.py   test_osutils.py-20051201224856-e48ee24c12182989
    ------------------------------------------------------------
    revno: 4133.1.1
    revision-id: v.ladeuil+lp at free.fr-20090312132005-cdcrdk8ps85c17o2
    parent: pqm at pqm.ubuntu.com-20090312120049-uxdmf2dfelp5ctva
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: 341648-fragile-test
    timestamp: Thu 2009-03-12 23:20:05 +1000
    message:
      Fix bzrlib.tests.test_osutils.TestWalkDirs.test_walkdirs_os_error
      by testing e.errno instead of the error string (which would have
      failed on non-english systems anyway).
    modified:
      bzrlib/tests/test_osutils.py   test_osutils.py-20051201224856-e48ee24c12182989
=== modified file 'bzrlib/tests/test_osutils.py'
--- a/bzrlib/tests/test_osutils.py	2009-03-10 00:49:23 +0000
+++ b/bzrlib/tests/test_osutils.py	2009-03-12 13:20:05 +0000
@@ -893,11 +893,9 @@
         # The error is not raised until the generator is actually evaluated.
         # (It would be ok if it happened earlier but at the moment it
         # doesn't.)
-        e = self.assertRaises(OSError, list,
-            osutils._walkdirs_utf8("."))
-        self.assertEquals(e.filename, './test-unreadable')
-        self.assertEquals(str(e),
-            "[Errno 13] chdir: Permission denied: './test-unreadable'")
+        e = self.assertRaises(OSError, list, osutils._walkdirs_utf8("."))
+        self.assertEquals('./test-unreadable', e.filename)
+        self.assertEquals(errno.EACCES, e.errno)
 
     def test__walkdirs_utf8(self):
         tree = [




More information about the bazaar-commits mailing list