mirror of
https://github.com/beetbox/beets.git
synced 2026-01-04 06:53:27 +01:00
Review: simpler implementation and test
Because **all** the path are bytestrings
This commit is contained in:
parent
819f03f0e0
commit
fb96660171
2 changed files with 2 additions and 4 deletions
|
|
@ -227,8 +227,6 @@ def path_as_posix(path):
|
|||
"""Return the string representation of the path with forward (/)
|
||||
slashes.
|
||||
"""
|
||||
if isinstance(path, str):
|
||||
return path.replace('\\', '/')
|
||||
return path.replace(b'\\', b'/')
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -196,8 +196,8 @@ class HelperTest(_common.TestCase):
|
|||
self.assertEqual(util.components(p), a)
|
||||
|
||||
def test_forward_slash(self):
|
||||
p = r'C:\a\b\c'
|
||||
a = r'C:/a/b/c'
|
||||
p = br'C:\a\b\c'
|
||||
a = br'C:/a/b/c'
|
||||
self.assertEqual(util.path_as_posix(p), a)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue