mirror of
https://github.com/beetbox/beets.git
synced 2026-01-04 06:53:27 +01:00
Add unit tests for separate "feat. X" detection
The unit tests for the `ftintitle.contains_feat` function are now split up for artist and title matching.
This commit is contained in:
parent
c66eb10445
commit
6cb2e5926b
1 changed files with 14 additions and 1 deletions
|
|
@ -175,7 +175,7 @@ class FtInTitlePluginTest(unittest.TestCase):
|
|||
parts = ftintitle.split_on_feat("Alice defeat Bob")
|
||||
assert parts == ("Alice defeat Bob", None)
|
||||
|
||||
def test_contains_feat(self):
|
||||
def test_contains_feat_artist(self):
|
||||
assert ftintitle.contains_feat("Alice ft. Bob")
|
||||
assert ftintitle.contains_feat("Alice feat. Bob")
|
||||
assert ftintitle.contains_feat("Alice feat Bob")
|
||||
|
|
@ -190,3 +190,16 @@ class FtInTitlePluginTest(unittest.TestCase):
|
|||
assert not ftintitle.contains_feat("Alice defeat Bob")
|
||||
assert not ftintitle.contains_feat("Aliceft.Bob")
|
||||
assert not ftintitle.contains_feat("Alice (defeat Bob)")
|
||||
|
||||
def test_contains_feat_title(self):
|
||||
assert ftintitle.contains_feat(
|
||||
"Live and Let Go (feat. Alice)", for_artist=False
|
||||
)
|
||||
assert ftintitle.contains_feat(
|
||||
"Live and Let Go [feat. Alice]", for_artist=False
|
||||
)
|
||||
assert ftintitle.contains_feat(
|
||||
"Live and Let Go feat. Alice", for_artist=False
|
||||
)
|
||||
assert not ftintitle.contains_feat("Live and Let Go", for_artist=False)
|
||||
assert not ftintitle.contains_feat("Come With Me", for_artist=False)
|
||||
|
|
|
|||
Loading…
Reference in a new issue