StarRailDamageCal/test.py

25 lines
761 B
Python
Raw Normal View History

2023-10-30 10:01:42 +00:00
import json
2023-11-09 02:06:46 +00:00
from typing import List, Union
2023-10-30 10:01:42 +00:00
2024-09-10 07:24:22 +00:00
from starrail_damage_cal.cal_damage import DamageCal, cal_char_info, get_char_data
from starrail_damage_cal.damage.Avatar import AvatarInstance
2024-08-02 09:59:15 +00:00
from starrail_damage_cal.to_data import api_to_dict
2023-10-30 10:01:42 +00:00
2023-10-31 02:17:24 +00:00
async def test_get_damage_data_by_uid() -> None:
2024-08-02 09:59:15 +00:00
# print(await api_to_dict("108069476"))
2024-09-10 07:24:22 +00:00
char_data = await get_char_data(uid="108069476", avatar_name="流萤")
if isinstance(char_data, Union[List, dict]):
print(json.dumps(char_data, ensure_ascii=False, indent=4))
char = await cal_char_info(char_data)
avatar = AvatarInstance(char)
print(avatar.base_attr)
print(avatar.attribute_bonus)
2023-10-30 10:01:42 +00:00
if __name__ == "__main__":
import asyncio
asyncio.run(test_get_damage_data_by_uid())