Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tofuSCHNITZEL authored Sep 6, 2024
1 parent e40a081 commit bddd52e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyopnsense/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ def test_post_success(self, request_mock):
response_mock.text = json.dumps({"a": "body"})
request_mock.return_value = response_mock
opnclient = client.OPNClient("", "", "")
resp = opnclient._post("fake_url", "body")
resp = opnclient._post("fake_url", {})
self.assertEqual({"a": "body"}, resp)
request_mock.assert_called_once_with(
"/fake_url", data="body", auth=("", ""), timeout=5, verify=False
"/fake_url", json={}, auth=("", ""), timeout=5, verify=False
)

@mock.patch("requests.post")
Expand All @@ -73,5 +73,5 @@ def test_post_failures(self, request_mock):
opnclient = client.OPNClient("", "", "")
self.assertRaises(exceptions.APIException, opnclient._post, "fake_url", "body")
request_mock.assert_called_once_with(
"/fake_url", data="body", auth=("", ""), timeout=5, verify=False
"/fake_url", json={}, auth=("", ""), timeout=5, verify=False
)

0 comments on commit bddd52e

Please sign in to comment.