Fix a test that was dependent on Windows path separators.
authorDaira Hopwood <daira@jacaranda.org>
Tue, 21 Apr 2015 20:28:21 +0000 (21:28 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Tue, 21 Apr 2015 20:28:21 +0000 (21:28 +0100)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/test/test_util.py

index 6c67fcc5fda1fdb1250523cd3f8e4891811d46c9..f2da9c4ba9c2e56b7dfa370c1e7ed9370a01401c 100644 (file)
@@ -488,10 +488,10 @@ class FileUtil(ReallyEqualMixin, unittest.TestCase):
         # adapted from <http://svn.python.org/view/python/branches/release26-maint/Lib/test/test_posixpath.py?view=markup&pathrev=78279#test_abspath>
 
         foo = fileutil.abspath_expanduser_unicode(u"foo")
-        self.failUnless(foo.endswith(u"\\foo"), foo)
+        self.failUnless(foo.endswith(u"%sfoo" % (os.path.sep,)), foo)
 
         foobar = fileutil.abspath_expanduser_unicode(u"bar", base=foo)
-        self.failUnless(foobar.endswith(u"\\foo\\bar"), foobar)
+        self.failUnless(foobar.endswith(u"%sfoo%sbar" % (os.path.sep, os.path.sep)), foobar)
 
         if sys.platform == "win32":
             # This is checking that a drive letter is added for a path without one.