From ba853b81c72f64972ab457b5c0e10d976b967e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sun, 29 Sep 2024 22:03:20 +0900 Subject: [PATCH] fix test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- .vscode/tasks.json | 3 +-- dist/compatible/openapi-3.0.yaml | 3 --- dist/compatible_discriminator/openapi-3.0.yaml | 3 --- dist/docs/openapi-3.0.yaml | 3 --- src/openapi/schemas/user.yaml | 3 --- test/python/test_serialize.py | 6 ++++-- test/python/test_serialize_guest.py | 2 ++ 7 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index b804f03..a70d1e4 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -16,7 +16,6 @@ "command": [ ".venv/Scripts/activate;", "python tools/build.py;", - "scoop reset temurin11-jdk;", "java -jar openapi-generator-cli.jar generate -c test/python/openapi-generator-config.yaml -g python;", "python -m pip install ./python_generated;" ] @@ -44,4 +43,4 @@ } } ] -} \ No newline at end of file +} diff --git a/dist/compatible/openapi-3.0.yaml b/dist/compatible/openapi-3.0.yaml index a42fe8e..d62894e 100644 --- a/dist/compatible/openapi-3.0.yaml +++ b/dist/compatible/openapi-3.0.yaml @@ -2793,8 +2793,6 @@ components: type: string type: array required: - - can_dm - - can_media_tag - created_at - default_profile - default_profile_image @@ -2820,7 +2818,6 @@ components: - statuses_count - translator_type - verified - - want_retweets UserLegacyExtendedProfile: properties: birthdate: diff --git a/dist/compatible_discriminator/openapi-3.0.yaml b/dist/compatible_discriminator/openapi-3.0.yaml index 3833d3e..fde043a 100644 --- a/dist/compatible_discriminator/openapi-3.0.yaml +++ b/dist/compatible_discriminator/openapi-3.0.yaml @@ -2793,8 +2793,6 @@ components: type: string type: array required: - - can_dm - - can_media_tag - created_at - default_profile - default_profile_image @@ -2820,7 +2818,6 @@ components: - statuses_count - translator_type - verified - - want_retweets UserLegacyExtendedProfile: properties: birthdate: diff --git a/dist/docs/openapi-3.0.yaml b/dist/docs/openapi-3.0.yaml index db1869c..2af419f 100644 --- a/dist/docs/openapi-3.0.yaml +++ b/dist/docs/openapi-3.0.yaml @@ -2793,8 +2793,6 @@ components: type: string type: array required: - - can_dm - - can_media_tag - created_at - default_profile - default_profile_image @@ -2820,7 +2818,6 @@ components: - statuses_count - translator_type - verified - - want_retweets UserLegacyExtendedProfile: properties: birthdate: diff --git a/src/openapi/schemas/user.yaml b/src/openapi/schemas/user.yaml index 6e24a54..f249210 100644 --- a/src/openapi/schemas/user.yaml +++ b/src/openapi/schemas/user.yaml @@ -240,8 +240,6 @@ components: UserLegacy: required: - - "can_dm" - - "can_media_tag" - "created_at" - "default_profile" - "default_profile_image" @@ -267,7 +265,6 @@ components: - "statuses_count" - "translator_type" - "verified" - - "want_retweets" properties: blocked_by: type: boolean diff --git a/test/python/test_serialize.py b/test/python/test_serialize.py index 62f5ca9..5f31b82 100644 --- a/test/python/test_serialize.py +++ b/test/python/test_serialize.py @@ -296,7 +296,7 @@ if __name__ == "__main__": try: logger.info("Try: Self UserByScreenName Test") - kwargs = get_kwargs("UserByScreenName", {"screen_name": "NxWDOyLMd483329"}) + kwargs = get_kwargs("UserByScreenName", {"screen_name": "ptcpz3"}) res = pt.UserApi(api_client).get_user_by_screen_name_with_http_info(**kwargs) data = res.data.to_dict() @@ -307,7 +307,7 @@ if __name__ == "__main__": ) logger.info(f"Match rate: {rate}") screen_name = data["data"]["user"]["result"]["legacy"]["screen_name"] - if not screen_name == "NxWDOyLMd483329": + if not screen_name == "ptcpz3": raise Exception("UserByScreenName failed") except Exception as e: error_dump(e) @@ -346,6 +346,8 @@ if __name__ == "__main__": # "1697450278742884799", "1749500209061663043", "1759056048764469303", + "1349129669258448897", + "1810188416812019999", ] for id in ids: try: diff --git a/test/python/test_serialize_guest.py b/test/python/test_serialize_guest.py index 40d1102..5079922 100644 --- a/test/python/test_serialize_guest.py +++ b/test/python/test_serialize_guest.py @@ -19,6 +19,8 @@ if __name__ == "__main__": if Path("cookie.json").exists(): with open("cookie.json", "r") as f: cookies = json.load(f) + if isinstance(cookies, list): + cookies = {k["name"]: k["value"] for k in cookies} cookies_str = "; ".join([f"{k}={v}" for k, v in cookies.items()]) with open("src/config/placeholder.json", "r") as f: