From 3322aafae4681ae1a7379c9ddb90f9a0f25e7a0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sat, 13 May 2023 23:09:46 +0200 Subject: [PATCH] add test file (to keep other files clean) --- test.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test.py diff --git a/test.py b/test.py new file mode 100644 index 0000000..ca12310 --- /dev/null +++ b/test.py @@ -0,0 +1,31 @@ +import json + +from variants import Variant +from variants import Suit, variant_name +from site_api import * +from download_data import download_games + +from database.init_database import init_database_tables, populate_static_tables + + +def test_suits(): + suit = Suit.from_db(55) + print(suit.__dict__) + + +def test_variant(): + var = Variant.from_db(926) + print(var.__dict__) + + +if __name__ == "__main__": + download_games(156) + print(variant_name(17888)) + for page in range(0, 4): + r = api("variants/0?size=20&col[0]=0&page={}".format(page)) + ids = [] + for game in r['rows']: + ids.append(game['id']) + r['rows'] = None + print(json.dumps(r, indent=2)) + print(ids)