Skip to content

Commit

Permalink
Get rid of legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef-Friedrich committed Jan 27, 2024
1 parent d1697df commit ec45ff7
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 232 deletions.
18 changes: 3 additions & 15 deletions tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,10 @@ class Cli:
__executed: bool = False
__stdout: Optional[str] = None
__stderr: Optional[str] = None
__legacy: bool = False
__append_score: bool

def __init__(
self, *args: CliArg, append_score: bool = True, legacy: bool = False
) -> None:
def __init__(self, *args: CliArg, append_score: bool = True) -> None:
self.__args = list(args)
self.__legacy = legacy
self.__append_score = append_score

def __set_score(self, score: Score, append_to_args: bool = False) -> Score:
Expand Down Expand Up @@ -191,11 +187,7 @@ def __execute(self) -> None:
stdout = StringIO()
stderr = StringIO()
with redirect_stdout(stdout), redirect_stderr(stderr):
if self.__legacy:
pass
# execute_legacy(self.__stringified_args)
else:
execute(self.__stringified_args)
execute(self.__stringified_args)
if self.__score is not None:
self.__score = self.__score.reload()
self.__stdout = stdout.getvalue()
Expand Down Expand Up @@ -236,12 +228,8 @@ def stderr(self) -> str:

def sysexit(self) -> str:
if not self.__executed:
script_name = "musescore-manager"
if self.__legacy:
script_name = "mscx-manager"

result = subprocess.run(
[script_name] + self.__stringified_args,
["musescore-manager"] + self.__stringified_args,
capture_output=True,
encoding="utf-8",
)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_lyrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,10 @@ def test_fix(version: int) -> None:
]


@pytest.mark.skip("Will be fixed later")
def test_remap() -> None:
score = helper.get_score("lyrics-remap.mscx")

Cli("lyrics", "--remap", "2:6", score, legacy=True).execute()
Cli("--remap-lyrics", "2:6", score).execute()
new_score = score.reload()
nos: list[int] = []

Expand Down
Loading

0 comments on commit ec45ff7

Please sign in to comment.