Skip to content

Commit

Permalink
also update patch request w/ burnettk
Browse files Browse the repository at this point in the history
  • Loading branch information
jasquat committed Feb 14, 2024
1 parent 46caa2b commit b79938f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from connector_http.http_request_base import HttpRequestBase


class PatchRequest(ConnectorCommand, HttpRequestBase):
class PatchRequestV2(ConnectorCommand, HttpRequestBase):
def __init__(
self,
url: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
from typing import Any
from unittest.mock import patch

from connector_http.commands.patch_request import PatchRequest
from connector_http.commands.patch_request_v2 import PatchRequestV2


class TestPatchRequest:
class TestPatchRequestV2:
def test_patch_html_from_url(self) -> None:
request = PatchRequest(url="http://example.com")
request = PatchRequestV2(url="http://example.com")
return_html = "<html>Hey</html>"
with patch("requests.patch") as mock_request:
mock_request.return_value.status_code = 200
Expand All @@ -24,7 +24,7 @@ def test_patch_html_from_url(self) -> None:
assert len(response["spiff__logs"]) > 0

def test_patch_json_from_url(self) -> None:
request = PatchRequest(url="http://example.com")
request = PatchRequestV2(url="http://example.com")
return_json = {"hey": "we_return"}
with patch("requests.patch") as mock_request:
mock_request.return_value.status_code = 200
Expand All @@ -43,7 +43,7 @@ def test_patch_json_from_url(self) -> None:
assert len(response["spiff__logs"]) > 0

def test_patch_can_handle_500(self, sleepless: Any) -> None:
request = PatchRequest(url="http://example.com")
request = PatchRequestV2(url="http://example.com")
return_json = {"error": "we_did_error"}
with patch("requests.patch") as mock_request:
mock_request.return_value.status_code = 500
Expand Down

0 comments on commit b79938f

Please sign in to comment.