Skip to content

Commit

Permalink
add test for netbox-community#545
Browse files Browse the repository at this point in the history
  • Loading branch information
ds committed Aug 25, 2023
1 parent 61f9bd7 commit 7b15af8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/unit/test_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ def test_filter_invalid_pagination_args(self):
with self.assertRaises(ValueError) as _:
test_obj.filter(offset=1)

def test_filter_replace_none_with_null(self):
with patch(
"pynetbox.core.query.Request._make_call", return_value=Mock()
):
api = Mock(base_url="http://localhost:8000/api")
app = Mock(name="test")
test_obj = Endpoint(api, app, "test")
test = test_obj.filter(name=None, id=0)

self.assertEqual(test.request.filters, {"name": "null", "id": 0})

def test_all_invalid_pagination_args(self):

api = Mock(base_url="http://localhost:8000/api")
Expand Down

0 comments on commit 7b15af8

Please sign in to comment.