From 6d70b79f277b8ff10286c82f53d8e9b87abc5e1a Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 8 Nov 2021 22:37:48 +0100 Subject: [PATCH] add a MockResponse --- tests/mocks.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/mocks.py diff --git a/tests/mocks.py b/tests/mocks.py new file mode 100644 index 0000000..afce127 --- /dev/null +++ b/tests/mocks.py @@ -0,0 +1,12 @@ +import json + + +class MockResponse: + + def __init__(self, data): + self.data = data + + # mock json() method always returns a specific testing dictionary + # @staticmethod + def json(self): + return json.loads(self.data)