diff --git a/src/speedruncompy/datatypes/defs.py b/src/speedruncompy/datatypes/defs.py index 67e0b7a..126360e 100644 --- a/src/speedruncompy/datatypes/defs.py +++ b/src/speedruncompy/datatypes/defs.py @@ -784,6 +784,12 @@ class Conversation(Datatype): lastMessageDate: int readDate: int +class ConversationLightweight(Datatype): + id: str + participantUserIds: list[str] # TODO: May always be empty? + lastMessageId: str + lastMessageDate: int + class ConversationParticipant(Datatype): conversationId: str userId: str diff --git a/src/speedruncompy/datatypes/responses.py b/src/speedruncompy/datatypes/responses.py index 6233b02..7b837a5 100644 --- a/src/speedruncompy/datatypes/responses.py +++ b/src/speedruncompy/datatypes/responses.py @@ -78,7 +78,7 @@ class r_GetStaticData(Datatype): platformList: list[Platform] regionList: list[Region] socialNetworkList: list[SocialNetwork] - supporterPlanList: OptField[list[Any]] # Unknown type + supporterPlanList: OptField[list[Any] | None] # Unknown type class r_GetGameData(Datatype): game: Game @@ -266,6 +266,7 @@ class r_GetUserComments(Datatype): runList: list[Run] threadList: list[Thread] userList: list[User] + pagination: Pagination class r_GetUserPopoverData(Datatype): user: User @@ -442,7 +443,7 @@ class r_PutUserSettings(Datatype): class r_GetUserApiKey(Datatype): apiKey: str -class r_GetUserGameBoostData(Datatype): # TODO: check which ones are optional +class r_GetUserGameBoostData(Datatype): boostAvailableTokens: int boostDistinctGamesCount: int boostDistinctUsersCount: int @@ -452,7 +453,7 @@ class r_GetUserGameBoostData(Datatype): # TODO: check which ones are optional boostNextTokenAmount: int boostNextTokenDate: int boostReceivedCount: int - boostGameList: list[GameBoost] + gameBoostList: list[GameBoost] gameList: list[Game] isBoosted: bool userList: list[User] @@ -460,7 +461,7 @@ class r_GetUserGameBoostData(Datatype): # TODO: check which ones are optional class r_GetUserDataExport(Datatype): articleList: list[Article] commentList: list[Comment] - conversationList: list[Conversation] + conversationList: list[ConversationLightweight] gameFollowerList: list[GameFollower] guideList: list[Guide] likeList: list[Like] @@ -474,7 +475,7 @@ class r_GetUserDataExport(Datatype): user: User userFollowerList: list[UserFollower] userSettings: UserSettings - UserSocialConnectionList: list[UserSocialConnection] + userSocialConnectionList: list[UserSocialConnection] class r_PutUserUpdateEmail(Datatype): emailChanged: bool diff --git a/test/test_datatypes.py b/test/test_datatypes.py index c41291d..ed0c241 100644 --- a/test/test_datatypes.py +++ b/test/test_datatypes.py @@ -111,22 +111,6 @@ class TestDT(Datatype): test: OptField[int] TestDT({}) # Test construction does not error - - def test_EnumMissingValue(self): - class TestEnum(enums.StrEnum): - ... # No values - - with pytest.raises(IncompleteEnum): - TestEnum("test") - - def test_EnumMissingValue_loose(self, caplog: pytest.LogCaptureFixture, loose_type_conformance): - class TestEnum(enums.StrEnum): - ... # No values - - with caplog.at_level(logging.WARNING): - TestEnum("test") - - assert "Enum TestEnum missing value test. Adding missing value..." in caplog.text @pytest.mark.skipif(SKIP_HEAVY_TESTS, reason="SKIP_HEAVY_TESTS == True") class TestDatatypes_Integration_Heavy(): diff --git a/test/test_endpoints.py b/test/test_endpoints.py index dc01a0b..1a3c748 100644 --- a/test/test_endpoints.py +++ b/test/test_endpoints.py @@ -362,11 +362,6 @@ def test_GetGameList(self): log_result(result) check_datatype_coverage(result) - def test_GetHomeSummary(self): - result = GetHomeSummary().perform() - log_result(result) - check_datatype_coverage(result) - def test_GetHomeSummary(self): result = GetHomeSummary(_api=self.api).perform() log_result(result) @@ -907,4 +902,4 @@ def test_PutUserUpdateName(self): def test_GetSeriesSettings(self): result = GetSeriesSettings("").perform() log_result(result) - check_datatype_coverage(result) \ No newline at end of file + check_datatype_coverage(result)