Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef-Friedrich committed Feb 2, 2024
1 parent 7a1b2e2 commit 4b69d34
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
Binary file not shown.
5 changes: 4 additions & 1 deletion tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
23 changes: 23 additions & 0 deletions tests/test_complex_tasks.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 4b69d34

Please sign in to comment.