-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement
rose releases edit
file-based metadata editing; impl pers…
…istent track IDs
- Loading branch information
Showing
13 changed files
with
619 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,43 @@ | ||
from rose.artiststr import Artists, format_artist_string, parse_artist_string | ||
from rose.artiststr import ArtistMapping, format_artist_string, parse_artist_string | ||
|
||
|
||
def test_parse_artist_string() -> None: | ||
assert parse_artist_string("A;B feat. C;D") == Artists( | ||
assert parse_artist_string("A;B feat. C;D") == ArtistMapping( | ||
main=["A", "B"], | ||
guest=["C", "D"], | ||
) | ||
assert parse_artist_string("A pres. C;D") == Artists( | ||
assert parse_artist_string("A pres. C;D") == ArtistMapping( | ||
djmixer=["A"], | ||
main=["C", "D"], | ||
) | ||
assert parse_artist_string("A performed by C;D") == Artists( | ||
assert parse_artist_string("A performed by C;D") == ArtistMapping( | ||
composer=["A"], | ||
main=["C", "D"], | ||
) | ||
assert parse_artist_string("A pres. B;C feat. D;E") == Artists( | ||
assert parse_artist_string("A pres. B;C feat. D;E") == ArtistMapping( | ||
djmixer=["A"], | ||
main=["B", "C"], | ||
guest=["D", "E"], | ||
) | ||
# Test the deduplication handling. | ||
assert parse_artist_string("A pres. B", dj="A") == Artists( | ||
assert parse_artist_string("A pres. B", dj="A") == ArtistMapping( | ||
djmixer=["A"], | ||
main=["B"], | ||
) | ||
|
||
|
||
def test_format_artist_string() -> None: | ||
assert format_artist_string(Artists(main=["A", "B"], guest=["C", "D"]), []) == "A;B feat. C;D" | ||
assert format_artist_string(Artists(djmixer=["A"], main=["C", "D"]), []) == "A pres. C;D" | ||
assert format_artist_string(Artists(composer=["A"], main=["C", "D"]), []) == "C;D" | ||
assert ( | ||
format_artist_string(Artists(composer=["A"], main=["C", "D"]), ["Classical"]) | ||
format_artist_string(ArtistMapping(main=["A", "B"], guest=["C", "D"]), []) | ||
== "A;B feat. C;D" | ||
) | ||
assert format_artist_string(ArtistMapping(djmixer=["A"], main=["C", "D"]), []) == "A pres. C;D" | ||
assert format_artist_string(ArtistMapping(composer=["A"], main=["C", "D"]), []) == "C;D" | ||
assert ( | ||
format_artist_string(ArtistMapping(composer=["A"], main=["C", "D"]), ["Classical"]) | ||
== "A performed by C;D" | ||
) | ||
assert ( | ||
format_artist_string(Artists(djmixer=["A"], main=["B", "C"], guest=["D", "E"]), []) | ||
format_artist_string(ArtistMapping(djmixer=["A"], main=["B", "C"], guest=["D", "E"]), []) | ||
== "A pres. B;C feat. D;E" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.