|
@@ -753,14 +753,14 @@ class TestTreeFSPathConversion(TestCase):
|
|
|
fs_path = _tree_to_fs_path(b'/prefix/path', tree_path)
|
|
|
self.assertEqual(
|
|
|
fs_path,
|
|
|
- os.path.join(u'/prefix/path', u'délwíçh', u'foo').encode('utf8'))
|
|
|
+ os.fsencode(os.path.join(u'/prefix/path', u'délwíçh', u'foo')))
|
|
|
|
|
|
def test_fs_to_tree_path_str(self):
|
|
|
fs_path = os.path.join(os.path.join(u'délwíçh', u'foo'))
|
|
|
- tree_path = _fs_to_tree_path(fs_path, "utf-8")
|
|
|
- self.assertEqual(tree_path, u'délwíçh/foo'.encode("utf-8"))
|
|
|
+ tree_path = _fs_to_tree_path(fs_path)
|
|
|
+ self.assertEqual(tree_path, u'délwíçh/foo'.encode('utf-8'))
|
|
|
|
|
|
def test_fs_to_tree_path_bytes(self):
|
|
|
- fs_path = os.path.join(os.path.join(u'délwíçh', u'foo').encode('utf8'))
|
|
|
- tree_path = _fs_to_tree_path(fs_path, "utf-8")
|
|
|
- self.assertEqual(tree_path, u'délwíçh/foo'.encode('utf8'))
|
|
|
+ fs_path = os.path.join(os.fsencode(os.path.join(u'délwíçh', u'foo')))
|
|
|
+ tree_path = _fs_to_tree_path(fs_path)
|
|
|
+ self.assertEqual(tree_path, u'délwíçh/foo'.encode('utf-8'))
|