Skip to content

Commit 075832b

Browse files
committed
Fix unit tests for api.version
1 parent 3633bd2 commit 075832b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/test_api.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ class ResponseHeadersWithVersion:
5151
headers = {"API-Version": "1.999"}
5252
ok = True
5353

54-
@patch("requests.get", return_value=ResponseHeadersWithVersion())
54+
@patch(
55+
"pynetbox.core.query.requests.sessions.Session.get",
56+
return_value=ResponseHeadersWithVersion(),
57+
)
5558
def test_api_version(self, *_):
5659
api = pynetbox.api(host,)
5760
self.assertEqual(api.version, "1.999")
@@ -60,7 +63,10 @@ class ResponseHeadersWithoutVersion:
6063
headers = {}
6164
ok = True
6265

63-
@patch("requests.get", return_value=ResponseHeadersWithoutVersion())
66+
@patch(
67+
"pynetbox.core.query.requests.sessions.Session.get",
68+
return_value=ResponseHeadersWithoutVersion(),
69+
)
6470
def test_api_version_not_found(self, *_):
6571
api = pynetbox.api(host,)
6672
self.assertEqual(api.version, "")

0 commit comments

Comments
 (0)