worthless-launcher/tests/launcher_api_cn_test.py

39 lines
1.3 KiB
Python
Raw Normal View History

import unittest
import asyncio
import worthless
from worthless.classes import launcher
client = worthless.Launcher(overseas=False)
class LauncherCNTest(unittest.TestCase):
def test_get_version_info(self):
version_info = asyncio.run(client.get_version_info())
print("get_version_info test.")
print("get_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("get_launcher_info: ", launcher_info)
print("raw: ", launcher_info.raw)
self.assertIsInstance(launcher_info, launcher.Info)
def test_get_launcher_full_info(self):
launcher_info = asyncio.run(client.get_launcher_full_info())
print("get_launcher_full_info test.")
print("get_launcher_full_info: ", launcher_info)
print("raw: ", launcher_info.raw)
self.assertIsInstance(launcher_info, launcher.Info)
def test_get_launcher_background_url(self):
bg_url = asyncio.run(client.get_launcher_background_url())
print("get_launcher_background_url test.")
print("get_launcher_background_url: ", bg_url)
self.assertIsInstance(bg_url, str)
self.assertTrue(bg_url)
if __name__ == '__main__':
unittest.main()