File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ def get_version(self):
197
197
headers = {
198
198
"Content-Type" : "application/json;" ,
199
199
}
200
- req = requests .get (self .normalize_url (self .base ), headers = headers ,)
200
+ req = self . http_session .get (self .normalize_url (self .base ), headers = headers ,)
201
201
if req .ok :
202
202
return req .headers .get ("API-Version" , "" )
203
203
else :
Original file line number Diff line number Diff line change @@ -51,7 +51,10 @@ class ResponseHeadersWithVersion:
51
51
headers = {"API-Version" : "1.999" }
52
52
ok = True
53
53
54
- @patch ("requests.get" , return_value = ResponseHeadersWithVersion ())
54
+ @patch (
55
+ "pynetbox.core.query.requests.sessions.Session.get" ,
56
+ return_value = ResponseHeadersWithVersion (),
57
+ )
55
58
def test_api_version (self , * _ ):
56
59
api = pynetbox .api (host ,)
57
60
self .assertEqual (api .version , "1.999" )
@@ -60,7 +63,10 @@ class ResponseHeadersWithoutVersion:
60
63
headers = {}
61
64
ok = True
62
65
63
- @patch ("requests.get" , return_value = ResponseHeadersWithoutVersion ())
66
+ @patch (
67
+ "pynetbox.core.query.requests.sessions.Session.get" ,
68
+ return_value = ResponseHeadersWithoutVersion (),
69
+ )
64
70
def test_api_version_not_found (self , * _ ):
65
71
api = pynetbox .api (host ,)
66
72
self .assertEqual (api .version , "" )
You can’t perform that action at this time.
0 commit comments