feat: add optional HLTB enrichment
CI / test (push) Successful in 7m10s

This commit is contained in:
strsv committed 2026-11-06 22:16:27 +03:00
1 parent b865a4a389
commit d07dec5e75
19 files changed
+258 -23

No files matched your search

+3
View File
@@ -104,6 +104,8 @@ class ApiTests(unittest.TestCase):
con.execute("INSERT INTO attributes (appid, key, value) VALUES (1, 'mood', 'calm')")
con.execute("""UPDATE games SET estimated_hours = CASE appid
WHEN 1 THEN 30 WHEN 2 THEN 10 WHEN 3 THEN 5 ELSE NULL END""")
con.execute("""UPDATE games SET hltb_main = 23.5, hltb_extra = 30.0,
hltb_complete = 50.0 WHERE appid = 1""")
con.commit()
def get(self, path, expect=200):
@@ -341,6 +343,7 @@ class ApiTests(unittest.TestCase):
self.assertEqual(data["size_gb"], 1.0)
self.assertEqual(data["steam_url"], "https://store.steampowered.com/app/1/")
self.assertEqual(data["attributes"], [{"key": "mood", "value": "calm"}])
self.assertEqual(data["hltb"], {"main": 23.5, "extra": 30.0, "complete": 50.0})
self.assertTrue(data["similar"])
self.assertEqual(data["similar"][0]["appid"], 2)