feat: add multi-select genre and tag filters
This commit is contained in:
1 parent
f1624cfde2
commit
7264a720ab
11 files changed
+183
-52
No files matched your search
@@ -192,6 +192,23 @@ class ApiTests(unittest.TestCase):
|
||||
self.assertEqual({g["appid"] for g in self.get("/api/games?unplayed=1")["items"]}, {2})
|
||||
self.assertEqual([g["appid"] for g in self.get("/api/games?favorite=1")["items"]], [1])
|
||||
|
||||
def test_multi_value_filters(self):
|
||||
self.assertEqual(
|
||||
{g["appid"] for g in self.get("/api/games?genre=RPG&genre=Horror")["items"]},
|
||||
{1, 2, 3})
|
||||
self.assertEqual(
|
||||
{g["appid"] for g in self.get("/api/games?genre=RPG,Horror")["items"]},
|
||||
{1, 2, 3})
|
||||
self.assertEqual(
|
||||
{g["appid"] for g in self.get("/api/games?tag=RPG&tag=Horror")["items"]},
|
||||
{1, 2, 3})
|
||||
self.assertEqual(
|
||||
{g["appid"] for g in self.get("/api/games?genre=RPG&tag=Party-Based%20RPG")["items"]},
|
||||
{1, 2})
|
||||
self.assertEqual(
|
||||
server.multi_values({"genre": ["RPG, Horror", "RPG"]}, "genre"),
|
||||
["RPG", "Horror"])
|
||||
|
||||
def test_search_by_name_description_tags_and_translation(self):
|
||||
self.assertEqual([g["appid"] for g in self.get("/api/games?q=alph")["items"]], [1])
|
||||
self.assertEqual([g["appid"] for g in self.get("/api/games?q=Short")["items"]], [1])
|
||||
|
||||
Reference in new issue
Block a user