Correctly encode arguments in tests

This commit is contained in:
Adrian Sampson 2016-05-31 15:32:09 -07:00
parent 9e27c9e5ac
commit 469aee9848

View file

@ -24,6 +24,7 @@ from test.helper import control_stdin
from beets.mediafile import MediaFile
from beets import util
from beets import ui
class TestHelper(helper.TestHelper):
@ -107,7 +108,11 @@ class ConvertCommand(object):
"""
def run_convert_path(self, path, *args):
"""Run the `convert` command on a given path."""
args = args + ('path:' + path,)
# The path is currently a filesystem bytestring. Convert it to
# an argument bytestring.
path = path.decode(util._fsencoding()).encode(ui._arg_encoding())
args = args + (b'path:' + path,)
return self.run_command('convert', *args)
def run_convert(self, *args):