diff --git a/tests/files/by_version/4/Im-Fruehtau-zu-Berge.mscz b/tests/files/by_version/4/Im-Fruehtau-zu-Berge.mscz new file mode 100644 index 0000000..0264530 Binary files /dev/null and b/tests/files/by_version/4/Im-Fruehtau-zu-Berge.mscz differ diff --git a/tests/helper.py b/tests/helper.py index 27c5408..2b91fe1 100644 --- a/tests/helper.py +++ b/tests/helper.py @@ -240,7 +240,10 @@ def sysexit(self, assert_none_zero: bool = False) -> str: raise Exception("No stdout or stderr") return self.__stderr + self.__stdout + def open_in_mscore(self) -> None: + open_in_gui(self.score().path) + def open_in_gui(file: str | Path) -> None: """Open a file wiht xdg-open in the background""" - subprocess.Popen(("/usr/local/bin/mscore", str(file))) + subprocess.Popen(("/usr/local/bin/mscore", str(file)), close_fds=True) diff --git a/tests/test_complex_tasks.py b/tests/test_complex_tasks.py new file mode 100644 index 0000000..ba43bcd --- /dev/null +++ b/tests/test_complex_tasks.py @@ -0,0 +1,23 @@ +"""Test the examples from the README.rst file.""" + +from __future__ import annotations + +from tests.helper import Cli + + +def test_din_a4_compress_rename() -> None: + score = ( + Cli( + "--save-in-mscore", + "--a4", + "--rename", + "_Piano_A4", + "--only-filename", + ) + .append_score("Im-Fruehtau-zu-Berge.mscz") + .score() + ) + + dest = score.path.parent / "_Piano_A4.mscz" + + assert dest.exists()