Skip to content

Commit

Permalink
Add tests for new queries
Browse files Browse the repository at this point in the history
  • Loading branch information
snejus committed May 4, 2024
1 parent fcc74eb commit cf33a04
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,26 @@ def test_get_albums_filter_by_album_flex(self):
results = self.lib.albums(q)
self.assert_albums_matched(results, ["Album1"])

def test_get_albums_filter_by_track_flex(self):
q = "item_flex1:Album1"
results = self.lib.albums(q)
self.assert_albums_matched(results, ["Album1"])

def test_get_items_filter_by_album_flex(self):
q = "album_flex:Album1"
results = self.lib.items(q)
self.assert_items_matched(results, ["Album1 Item1", "Album1 Item2"])

def test_filter_by_flex(self):
q = "item_flex1:'Item1 Flex1'"
results = self.lib.items(q)
self.assert_items_matched(results, ["Album1 Item1", "Album2 Item1"])

def test_filter_by_many_flex(self):
q = "item_flex1:'Item1 Flex1' item_flex2:Album1"
results = self.lib.items(q)
self.assert_items_matched(results, ["Album1 Item1"])


def suite():
return unittest.TestLoader().loadTestsFromName(__name__)
Expand Down

0 comments on commit cf33a04

Please sign in to comment.