]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/test/test_encodingutil.py
Fix a corner case for to_filepath on Windows to make it consistent with Unix.
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / test / test_encodingutil.py
index 3650daf81d17a88bef19d9fe4108d045115148bb..49db1d187fe3247e68544fbc44d4d955978554c3 100644 (file)
@@ -447,6 +447,14 @@ class QuotePaths(ReallyEqualMixin, unittest.TestCase):
         self.failUnlessReallyEqual(quote_filepath(foo_bar_fp, quotemarks=False),
                                    win32_other("C:\\foo\\bar", "/foo/bar"))
 
+        foo_longfp = FilePath(u'\\\\?\\C:\\foo')
+        self.failUnlessReallyEqual(quote_filepath(foo_longfp),
+                                   win32_other("'C:\\foo'", "'\\\\?\\C:\\foo'"))
+        self.failUnlessReallyEqual(quote_filepath(foo_longfp, quotemarks=True),
+                                   win32_other("'C:\\foo'", "'\\\\?\\C:\\foo'"))
+        self.failUnlessReallyEqual(quote_filepath(foo_longfp, quotemarks=False),
+                                   win32_other("C:\\foo", "\\\\?\\C:\\foo"))
+
 
 class FilePaths(ReallyEqualMixin, unittest.TestCase):
     def test_to_filepath(self):