2022-01-28 13:08:53 +00:00
|
|
|
import unittest
|
|
|
|
import asyncio
|
|
|
|
import worthless
|
2022-02-16 15:18:56 +00:00
|
|
|
from worthless.classes import launcher, installer
|
|
|
|
game_launcher = worthless.Launcher()
|
|
|
|
game_installer = worthless.Installer()
|
2022-01-28 13:08:53 +00:00
|
|
|
|
|
|
|
|
2022-02-15 17:49:33 +00:00
|
|
|
class LauncherOverseasTest(unittest.TestCase):
|
2022-01-28 13:08:53 +00:00
|
|
|
def test_get_version_info(self):
|
2022-02-16 15:18:56 +00:00
|
|
|
version_info = asyncio.run(game_launcher.get_resource_info())
|
|
|
|
print("get_resource_info test.")
|
|
|
|
print("get_resource_info: ", version_info)
|
|
|
|
print("raw: ", version_info.raw)
|
|
|
|
self.assertIsInstance(version_info, installer.Resource)
|
2022-01-28 13:08:53 +00:00
|
|
|
|
|
|
|
def test_get_launcher_info(self):
|
2022-02-16 15:18:56 +00:00
|
|
|
launcher_info = asyncio.run(game_launcher.get_launcher_info())
|
2022-01-28 13:08:53 +00:00
|
|
|
print("get_launcher_info test.")
|
|
|
|
print("get_launcher_info: ", launcher_info)
|
2022-02-15 17:49:33 +00:00
|
|
|
print("raw: ", launcher_info.raw)
|
2022-01-29 16:32:38 +00:00
|
|
|
self.assertIsInstance(launcher_info, launcher.Info)
|
2022-01-28 13:08:53 +00:00
|
|
|
|
|
|
|
def test_get_launcher_full_info(self):
|
2022-02-16 15:18:56 +00:00
|
|
|
launcher_info = asyncio.run(game_launcher.get_launcher_full_info())
|
2022-01-28 13:08:53 +00:00
|
|
|
print("get_launcher_full_info test.")
|
|
|
|
print("get_launcher_full_info: ", launcher_info)
|
2022-02-15 17:49:33 +00:00
|
|
|
print("raw: ", launcher_info.raw)
|
2022-01-29 16:32:38 +00:00
|
|
|
self.assertIsInstance(launcher_info, launcher.Info)
|
2022-01-28 13:08:53 +00:00
|
|
|
|
|
|
|
def test_get_launcher_background_url(self):
|
2022-02-16 15:18:56 +00:00
|
|
|
bg_url = asyncio.run(game_launcher.get_launcher_background_url())
|
2022-01-28 13:08:53 +00:00
|
|
|
print("get_launcher_background_url test.")
|
|
|
|
print("get_launcher_background_url: ", bg_url)
|
|
|
|
self.assertIsInstance(bg_url, str)
|
|
|
|
self.assertTrue(bg_url)
|
|
|
|
|
2022-02-18 04:11:55 +00:00
|
|
|
def test_get_installer_game_diff(self):
|
2022-02-16 15:18:56 +00:00
|
|
|
game_diff = asyncio.run(game_installer.get_game_diff_archive("2.4.0"))
|
|
|
|
print("get_game_diff_archive test.")
|
|
|
|
print("get_game_diff_archive: ", game_diff)
|
|
|
|
print("raw: ", game_diff.raw)
|
|
|
|
self.assertIsInstance(game_diff, installer.Diff)
|
|
|
|
|
2022-02-18 04:11:55 +00:00
|
|
|
def test_get_installer_voiceover_diff_one(self):
|
|
|
|
game_diff = asyncio.run(game_installer.get_voiceover_diff_archive("en-us", "2.4.0"))
|
|
|
|
print("get_voiceover_diff_archive test one (en-us)")
|
|
|
|
print("get_voiceover_diff_archive: ", game_diff)
|
|
|
|
print("raw: ", game_diff.raw)
|
|
|
|
self.assertIsInstance(game_diff, installer.Voicepack)
|
|
|
|
|
|
|
|
def test_get_installer_voiceover_diff_two(self):
|
|
|
|
game_diff = asyncio.run(game_installer.get_voiceover_diff_archive("en-us", "2.4.0"))
|
|
|
|
print("get_voiceover_diff_archive test two (English(US))")
|
|
|
|
print("get_voiceover_diff_archive: ", game_diff)
|
|
|
|
print("raw: ", game_diff.raw)
|
|
|
|
self.assertIsInstance(game_diff, installer.Voicepack)
|
2022-01-28 13:08:53 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|