test_encodingutil: fixes for Unix.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
5f98d73216
commit
3fab5caa02
|
@ -447,13 +447,14 @@ class QuotePaths(ReallyEqualMixin, unittest.TestCase):
|
||||||
self.failUnlessReallyEqual(quote_filepath(foo_bar_fp, quotemarks=False),
|
self.failUnlessReallyEqual(quote_filepath(foo_bar_fp, quotemarks=False),
|
||||||
win32_other("C:\\foo\\bar", "/foo/bar"))
|
win32_other("C:\\foo\\bar", "/foo/bar"))
|
||||||
|
|
||||||
|
if sys.platform == "win32":
|
||||||
foo_longfp = FilePath(u'\\\\?\\C:\\foo')
|
foo_longfp = FilePath(u'\\\\?\\C:\\foo')
|
||||||
self.failUnlessReallyEqual(quote_filepath(foo_longfp),
|
self.failUnlessReallyEqual(quote_filepath(foo_longfp),
|
||||||
win32_other("'C:\\foo'", "'\\\\?\\C:\\foo'"))
|
"'C:\\foo'")
|
||||||
self.failUnlessReallyEqual(quote_filepath(foo_longfp, quotemarks=True),
|
self.failUnlessReallyEqual(quote_filepath(foo_longfp, quotemarks=True),
|
||||||
win32_other("'C:\\foo'", "'\\\\?\\C:\\foo'"))
|
"'C:\\foo'")
|
||||||
self.failUnlessReallyEqual(quote_filepath(foo_longfp, quotemarks=False),
|
self.failUnlessReallyEqual(quote_filepath(foo_longfp, quotemarks=False),
|
||||||
win32_other("C:\\foo", "\\\\?\\C:\\foo"))
|
"C:\\foo")
|
||||||
|
|
||||||
|
|
||||||
class FilePaths(ReallyEqualMixin, unittest.TestCase):
|
class FilePaths(ReallyEqualMixin, unittest.TestCase):
|
||||||
|
@ -465,6 +466,7 @@ class FilePaths(ReallyEqualMixin, unittest.TestCase):
|
||||||
|
|
||||||
for fp in (nosep_fp, sep_fp):
|
for fp in (nosep_fp, sep_fp):
|
||||||
self.failUnlessReallyEqual(fp, FilePath(foo_u))
|
self.failUnlessReallyEqual(fp, FilePath(foo_u))
|
||||||
|
if encodingutil.use_unicode_filepath:
|
||||||
self.failUnlessReallyEqual(fp.path, foo_u)
|
self.failUnlessReallyEqual(fp.path, foo_u)
|
||||||
|
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
|
@ -481,6 +483,7 @@ class FilePaths(ReallyEqualMixin, unittest.TestCase):
|
||||||
for foo_fp in (foo_bfp, foo_ufp):
|
for foo_fp in (foo_bfp, foo_ufp):
|
||||||
fp = extend_filepath(foo_fp, [u'bar', u'baz'])
|
fp = extend_filepath(foo_fp, [u'bar', u'baz'])
|
||||||
self.failUnlessReallyEqual(fp, FilePath(foo_bar_baz_u))
|
self.failUnlessReallyEqual(fp, FilePath(foo_bar_baz_u))
|
||||||
|
if encodingutil.use_unicode_filepath:
|
||||||
self.failUnlessReallyEqual(fp.path, foo_bar_baz_u)
|
self.failUnlessReallyEqual(fp.path, foo_bar_baz_u)
|
||||||
|
|
||||||
def test_unicode_from_filepath(self):
|
def test_unicode_from_filepath(self):
|
||||||
|
|
Loading…
Reference in New Issue