Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Josef-Friedrich/mscxyz
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef-Friedrich committed Jan 17, 2024
2 parents 8a76ffd + 9f85c40 commit 1952718
Showing 1 changed file with 33 additions and 23 deletions.
56 changes: 33 additions & 23 deletions tests/test_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,10 +868,12 @@ def test_option_combined(self) -> None:
class TestOptionSetField:
@pytest.mark.legacy
def test_simple_string_legacy(self) -> None:
tmp = helper.get_score("meta-all-values.mscx")
Cli("meta", "--set-field", "vbox_title", "test", tmp, legacy=True).execute()
i = reload(tmp)
assert i.vbox_title == "test"
c = (
Cli("meta", "--set-field", "vbox_title", "test", legacy=True)
.append_score("meta-all-values.mscz")
.execute()
)
assert c.post.meta.interface.vbox_title == "test"

def test_simple_string(self) -> None:
c = (
Expand All @@ -883,19 +885,21 @@ def test_simple_string(self) -> None:

@pytest.mark.legacy
def test_multiple_times_legacy(self) -> None:
tmp = helper.get_score("meta-all-values.mscx")
Cli(
"meta",
"--set-field",
"vbox_title",
"vt",
"--set-field",
"vbox_composer",
"vc",
tmp,
legacy=True,
).execute()
i = reload(tmp)
c = (
Cli(
"meta",
"--set-field",
"vbox_title",
"vt",
"--set-field",
"vbox_composer",
"vc",
legacy=True,
)
.append_score("meta-all-values.mscz")
.execute()
)
i = c.post.meta.interface
assert i.vbox_title == "vt"
assert i.vbox_composer == "vc"

Expand Down Expand Up @@ -962,9 +966,12 @@ def test_log(self, tmp_path: Path) -> None:
class TestOptionDeleteDuplicates:
@pytest.mark.legacy
def test_normal_legacy(self) -> None:
tmp = helper.get_score("meta-duplicates.mscx")
Cli("meta", "--delete-duplicates", tmp, legacy=True).execute()
i = reload(tmp)
c = (
Cli("meta", "--delete-duplicates", legacy=True)
.append_score("meta-duplicates.mscz")
.execute()
)
i = c.post.meta.interface
assert not i.combined_lyricist
assert not i.combined_subtitle

Expand All @@ -976,9 +983,12 @@ def test_normal(self) -> None:

@pytest.mark.legacy
def test_move_subtitle_legacy(self) -> None:
tmp = helper.get_score("meta-duplicates-move-subtitle.mscx")
Cli("meta", "--delete-duplicates", tmp, legacy=True).execute()
i = reload(tmp)
c = (
Cli("meta", "--delete-duplicates", legacy=True)
.append_score("meta-duplicates-move-subtitle.mscz")
.execute()
)
i = c.post.meta.interface
assert not i.combined_lyricist
assert not i.combined_subtitle
assert i.combined_title == "Title"
Expand Down

0 comments on commit 1952718

Please sign in to comment.