|
33 | 33 |
|
34 | 34 |
|
35 | 35 | class TestLyricsUtils:
|
36 |
| - unexpected_empty_artist = pytest.mark.xfail( |
37 |
| - reason="Empty artist '' should not be present" |
| 36 | + @pytest.mark.parametrize( |
| 37 | + "artist, title", |
| 38 | + [ |
| 39 | + ("Artist", ""), |
| 40 | + ("", "Title"), |
| 41 | + (" ", ""), |
| 42 | + ("", " "), |
| 43 | + ("", ""), |
| 44 | + ], |
38 | 45 | )
|
| 46 | + def test_search_empty(self, artist, title): |
| 47 | + actual_pairs = lyrics.search_pairs(Item(artist=artist, title=title)) |
| 48 | + |
| 49 | + assert not list(actual_pairs) |
39 | 50 |
|
40 | 51 | @pytest.mark.parametrize(
|
41 | 52 | "artist, artist_sort, expected_extra_artists",
|
42 | 53 | [
|
43 |
| - _p("Alice ft. Bob", "", ["Alice"], marks=unexpected_empty_artist), |
44 |
| - _p("Alice feat Bob", "", ["Alice"], marks=unexpected_empty_artist), |
45 |
| - _p("Alice feat. Bob", "", ["Alice"], marks=unexpected_empty_artist), |
46 |
| - _p("Alice feats Bob", "", [], marks=unexpected_empty_artist), |
47 |
| - _p("Alice featuring Bob", "", ["Alice"], marks=unexpected_empty_artist), |
48 |
| - _p("Alice & Bob", "", ["Alice"], marks=unexpected_empty_artist), |
49 |
| - _p("Alice and Bob", "", ["Alice"], marks=unexpected_empty_artist), |
50 |
| - _p("Alice", "", [], marks=unexpected_empty_artist), |
| 54 | + ("Alice ft. Bob", "", ["Alice"]), |
| 55 | + ("Alice feat Bob", "", ["Alice"]), |
| 56 | + ("Alice feat. Bob", "", ["Alice"]), |
| 57 | + ("Alice feats Bob", "", []), |
| 58 | + ("Alice featuring Bob", "", ["Alice"]), |
| 59 | + ("Alice & Bob", "", ["Alice"]), |
| 60 | + ("Alice and Bob", "", ["Alice"]), |
| 61 | + ("Alice", "", []), |
| 62 | + ("Alice", "Alice", []), |
| 63 | + ("Alice", "alice", []), |
| 64 | + ("Alice", "alice ", []), |
| 65 | + ("Alice", "Alice A", ["Alice A"]), |
51 | 66 | ("CHVRCHΞS", "CHVRCHES", ["CHVRCHES"]),
|
52 | 67 | ("横山克", "Masaru Yokoyama", ["Masaru Yokoyama"]),
|
53 | 68 | ],
|
|
0 commit comments