From bbbec5569f85f74894dd8f6a1930e2fc70c207a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Fri, 15 Sep 2023 19:16:48 +0900 Subject: [PATCH] update test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- src/openapi/schemas/content.yaml | 11 ++++++----- test/python/test_serialize.py | 7 +++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openapi/schemas/content.yaml b/src/openapi/schemas/content.yaml index 184e274..b2a5ed1 100644 --- a/src/openapi/schemas/content.yaml +++ b/src/openapi/schemas/content.yaml @@ -219,14 +219,15 @@ components: additionalProperties: true # todo ClientEventInfo: - required: - - component - - elemen properties: component: - type: string # enum half_cover + # enum half_cover + type: string element: type: string # august-2023-privacy-prompt-candidate - pattern: "(([a-z]+|[0-9]+|[0-9a-f]+)(-|$))+" + # pattern: "(([a-z]+|[0-9]+|[0-9a-f]+)(-|$))+" # pattern: "^(january|february|march|april|may|june|july|august|september|october|november|december)-[0-9]{4}-([a-z]-)+[a-z]+$" + details: + type: object + additionalProperties: true # todo diff --git a/test/python/test_serialize.py b/test/python/test_serialize.py index b619e6c..4968856 100644 --- a/test/python/test_serialize.py +++ b/test/python/test_serialize.py @@ -113,10 +113,10 @@ def task_callback(file, thread=True): cache = json.load(f) data = pt.__dict__[cache["type"]].from_json(cache["raw"]) rate = match_rate(data.to_dict(), json.loads(cache["raw"])) - return {rate}, {file} + return rate, file except Exception as e: if thread: - return 0, {file} + return 0, file else: raise @@ -153,8 +153,7 @@ if __name__ == "__main__": with concurrent.futures.ProcessPoolExecutor() as executor: tasks = [executor.submit(task_callback, x) for x in glob.glob("cache/*.json")] for task in concurrent.futures.as_completed(tasks): - rate, file = [list(x).pop() for x in task.result()] - print(rate, file) + rate, file = task.result() if rate < 1: fail.append(file) logger.info(f"Match rate: {rate}")