Skip to content

Commit

Permalink
Merge pull request #319 from ignatenkobrain/master
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
Zach Moody authored Dec 30, 2020
2 parents 636ddeb + 8a3ff35 commit 7d93576
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def json(self):
}

@patch(
"pynetbox.core.query.requests.sessions.Session.get",
"requests.sessions.Session.get",
return_value=ResponseWithStatus(),
)
def test_api_status(self, *_):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dcim.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def test_get_all(self, mock):
)

@patch(
"pynetbox.core.query.requests.sessions.Session.get",
"requests.sessions.Session.get",
side_effect=[
Response(fixture="dcim/interface.json"),
Response(fixture="dcim/interface_trace.json"),
Expand Down
8 changes: 4 additions & 4 deletions tests/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Tests(unittest.TestCase):

def test_get_all(self):
with patch(
"pynetbox.core.query.requests.sessions.Session.get",
"requests.sessions.Session.get",
return_value=Response(fixture="{}/{}.json".format(self.app, self.name)),
) as mock:
ret = getattr(nb, self.name).all()
Expand All @@ -43,7 +43,7 @@ def test_get_all(self):

def test_filter(self):
with patch(
"pynetbox.core.query.requests.sessions.Session.get",
"requests.sessions.Session.get",
return_value=Response(fixture="{}/{}.json".format(self.app, self.name)),
) as mock:
ret = getattr(nb, self.name).filter(name="test")
Expand All @@ -61,7 +61,7 @@ def test_filter(self):

def test_get(self):
with patch(
"pynetbox.core.query.requests.sessions.Session.get",
"requests.sessions.Session.get",
return_value=Response(
fixture="{}/{}.json".format(self.app, self.name[:-1])
),
Expand All @@ -83,7 +83,7 @@ class UsersTestCase(Generic.Tests):
name = "users"

@patch(
"pynetbox.core.query.requests.sessions.Session.get",
"requests.sessions.Session.get",
return_value=Response(fixture="users/user.json"),
)
def test_repr(self, _):
Expand Down

0 comments on commit 7d93576

Please sign in to comment.