Switch to uv from poetry
This commit is contained in:
@@ -1,20 +1,23 @@
|
||||
import requests
|
||||
import json
|
||||
|
||||
from typing import Any
|
||||
|
||||
def mocked_requests_get(*args, **kwargs):
|
||||
class MockedResponse:
|
||||
def __init__(self, json_data, status_code):
|
||||
self.json_data = json_data
|
||||
self.status_code = status_code
|
||||
|
||||
def json(self):
|
||||
return json.loads(self.json_data)
|
||||
class MockedResponse:
|
||||
def __init__(self, json_data: bytes, status_code: int) -> None:
|
||||
self.json_data = json_data
|
||||
self.status_code = status_code
|
||||
|
||||
def raise_for_status(self):
|
||||
if self.status_code not in [200, 201]:
|
||||
raise requests.exceptions.HTTPError()
|
||||
def json(self) -> Any:
|
||||
return json.loads(self.json_data)
|
||||
|
||||
def raise_for_status(self) -> None:
|
||||
if self.status_code not in [200, 201]:
|
||||
raise requests.exceptions.HTTPError()
|
||||
|
||||
|
||||
def mocked_requests_get(*args, **kwargs) -> MockedResponse:
|
||||
if "pulls" in args[0]:
|
||||
pr = args[0].split("/")[-1]
|
||||
with open(f"tests/fixtures/pulls_{pr}.json") as f:
|
||||
|
Reference in New Issue
Block a user