From 5769e8f5a42c7ca9b3e212947f3fdaa97fdbf8e3 Mon Sep 17 00:00:00 2001 From: Timo S Date: Sun, 27 Dec 2020 15:40:26 +0100 Subject: [PATCH 1/2] force file encoding to utf-8, like in respones api --- tests/mockup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mockup.py b/tests/mockup.py index abffdf450..8fb03dd4f 100644 --- a/tests/mockup.py +++ b/tests/mockup.py @@ -30,7 +30,7 @@ def request_mookup(*args, **kwargs): response_file = os.path.join(RESPONSE_ROOT, url, method) try: - with open(response_file) as f: + with open(response_file, encoding="utf-8") as f: data = {"responses": {}, "__builtins__": {}, "true": True, "false": False} exec(f.read(), data) data = data["responses"][response_key] From 3b716bcfc877be9dd76fef37020ce92c81e4ac96 Mon Sep 17 00:00:00 2001 From: Timo S Date: Sun, 27 Dec 2020 20:43:43 +0100 Subject: [PATCH 2/2] Add exec-global, "null" = None --- tests/mockup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mockup.py b/tests/mockup.py index 9e9abddff..4e26ba53c 100644 --- a/tests/mockup.py +++ b/tests/mockup.py @@ -31,7 +31,7 @@ def request_mookup(*args, **kwargs): response_file = os.path.join(RESPONSE_ROOT, url, method) try: with open(response_file, encoding="utf-8") as f: - data = {"responses": {}, "__builtins__": {}, "true": True, "false": False} + data = {"responses": {}, "__builtins__": {}, "true": True, "false": False, "null": None} exec(f.read(), data) data = data["responses"][response_key] if type(data) is dict: