From 8f32241191ffe6939bf909c4249b0a6f1c187cb7 Mon Sep 17 00:00:00 2001 From: tretrauit Date: Fri, 28 Jan 2022 20:17:56 +0700 Subject: [PATCH] Delete obsolete source folder --- src/__main__.py | 0 src/app.py | 0 src/tests/launcher_api_test.py | 28 ---------------------------- src/worthless/__init__.py | 0 src/worthless/constants.py | 0 src/worthless/launcher.py | 26 -------------------------- 6 files changed, 54 deletions(-) delete mode 100644 src/__main__.py delete mode 100644 src/app.py delete mode 100644 src/tests/launcher_api_test.py delete mode 100644 src/worthless/__init__.py delete mode 100644 src/worthless/constants.py delete mode 100644 src/worthless/launcher.py diff --git a/src/__main__.py b/src/__main__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/app.py b/src/app.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/tests/launcher_api_test.py b/src/tests/launcher_api_test.py deleted file mode 100644 index 3af4139..0000000 --- a/src/tests/launcher_api_test.py +++ /dev/null @@ -1,28 +0,0 @@ -import unittest -import asyncio -import worthless -client = worthless.Launcher() - - -class LauncherTest(unittest.TestCase): - def test_get_version_info(self): - version_info = asyncio.run(client.get_version_info()) - print("get_version_info test.") - print("version_info: ", version_info) - self.assertIsInstance(version_info, dict) - - def test_get_launcher_info(self): - launcher_info = asyncio.run(client.get_launcher_info()) - print("get_launcher_info test.") - print("launcher_info: ", launcher_info) - self.assertIsInstance(launcher_info, dict) - - def test_get_launcher_full_info(self): - launcher_info = asyncio.run(client.get_launcher_full_info()) - print("get_launcher_full_info test.") - print("launcher_full_info: ", launcher_info) - self.assertIsInstance(launcher_info, dict) - - -if __name__ == '__main__': - unittest.main() diff --git a/src/worthless/__init__.py b/src/worthless/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/worthless/constants.py b/src/worthless/constants.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/worthless/launcher.py b/src/worthless/launcher.py deleted file mode 100644 index b7aca88..0000000 --- a/src/worthless/launcher.py +++ /dev/null @@ -1,26 +0,0 @@ -import aiohttp -from worthless import constants - - -class Launcher: - def __init__(self): - self._api = constants.LAUNCHER_API_URL - - # Workaround because miHoYo uses retcode for their API - @staticmethod - async def _get(url, **kwargs): - async with aiohttp.ClientSession() as session: - rsp = await session.get(url, **kwargs) - rsp_json = await rsp.json() - # Why retcode seriously? They can just make the page not returning 200 status code. - if rsp_json["retcode"] != 0: - raise aiohttp.ClientResponseError(code=rsp_json["retcode"], - message=rsp_json["message"], - history=rsp.history, - request_info=rsp.request_info) - return rsp_json - - async def get_version_info(self): - rsp = await self._get(self._api + "/resource", params={"key": "gcStgarh", - "launcher_id": "10"}) - return rsp