Skip to content

Commit e87d6f4

Browse files
committed
smartplaylist: Test new shell quoting behavior
1 parent 305eb9a commit e87d6f4

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

test/plugins/test_smartplaylist.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,3 +574,20 @@ def test_splupdate(self):
574574
for name in (b"my_playlist.m3u", b"all.m3u"):
575575
with open(path.join(self.temp_dir, name), "rb") as f:
576576
assert f.read() == self.item.path + b"\n"
577+
578+
def test_splupdate_unknown_playlist_error_is_sorted_and_quoted(self):
579+
config["smartplaylist"]["playlists"].set(
580+
[
581+
{"name": "z last.m3u", "query": self.item.title},
582+
{"name": "rock'n roll.m3u", "query": self.item.title},
583+
{"name": "a one.m3u", "query": self.item.title},
584+
]
585+
)
586+
587+
with pytest.raises(UserError) as exc_info:
588+
self.run_with_output("splupdate", "tagada")
589+
590+
assert str(exc_info.value) == (
591+
"No playlist matching any of "
592+
"'a one.m3u' 'rock'\"'\"'n roll.m3u' 'z last.m3u' found"
593+
)

0 commit comments

Comments
 (0)