Skip to content

Commit

Permalink
adjusted tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mlodic committed Feb 8, 2024
1 parent 34a11af commit e159afe
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,28 @@
ROOT_DIR = pathlib.Path(__file__).parent.parent


class MockRequest:
def __init__(self, headers):
self.headers = headers


# class for mocking responses
class MockResponse:
def __init__(self, json_data, status_code, uri, content=None, headers=None):
def __init__(
self,
json_data,
status_code,
uri,
content=None,
headers=None,
request_headers=None,
):
self.headers = headers
self.json_data = json_data
self.status_code = status_code
self.content = content
self.url = "http://localhost:80" + uri
self.request = MockRequest(request_headers)

def json(self):
return self.json_data
Expand Down

0 comments on commit e159afe

Please sign in to comment.