Skip to content

Commit

Permalink
Fix typos and improve test names
Browse files Browse the repository at this point in the history
Co-authored-by: Morten Brekkevold <[email protected]>
  • Loading branch information
jorund1 and lunkwill42 committed Dec 6, 2024
1 parent 01dd43d commit c56ef5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python/nav/ipdevpoll/plugins/paloaltoarp.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def _get_paloalto_arp_mappings(self, address: IP, key: str):

@defer.inlineCallbacks
def _do_request(self, address: IP, key: str):
"""Make a HTTP request to Paloalto device"""
"""Make an HTTP request to a Palo Alto device"""

class SslPolicy(client.BrowserLikePolicyForHTTPS):
def creatorForNetloc(self, hostname, port):
Expand Down
8 changes: 4 additions & 4 deletions tests/unittests/ipdevpoll/plugins_paloaltoarp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
'''


def test_should_correctly_parse_valid_http_response_body():
def test_parse_arp_should_correctly_parse_valid_http_response_body():
assert _parse_arp(valid_http_response_body) == [
('ifindex', IP('192.168.0.1'), '00:00:00:00:00:01'),
('ifindex', IP('192.168.0.2'), '00:00:00:00:00:02'),
Expand All @@ -64,7 +64,7 @@ def test_should_correctly_parse_valid_http_response_body():

@pytest.mark.twisted
@pytest_twisted.inlineCallbacks
def test_should_return_arp_mappings_on_valid_http_response(paloaltoarp):
def test_get_paloalto_arp_mappings_should_return_arp_mappings_on_valid_http_response(paloaltoarp):
with patch.object(
PaloaltoArp, "_do_request", return_value=defer.succeed(valid_http_response_body)
):
Expand All @@ -82,7 +82,7 @@ def test_should_return_arp_mappings_on_valid_http_response(paloaltoarp):

@pytest.mark.twisted
@pytest_twisted.inlineCallbacks
def test_should_return_empty_list_on_request_error(paloaltoarp):
def test_get_paloalto_arp_mappings_should_return_empty_list_on_request_error(paloaltoarp):
with patch.object(PaloaltoArp, "_do_request", return_value=defer.succeed(None)):
mappings = yield paloaltoarp._get_paloalto_arp_mappings(
IP("10.0.0.0"), "incorrect_key"
Expand All @@ -92,7 +92,7 @@ def test_should_return_empty_list_on_request_error(paloaltoarp):

@pytest.mark.twisted
@pytest_twisted.inlineCallbacks
def test_should_form_correct_api_query_url(paloaltoarp):
def test_do_request_should_form_correct_api_query_url(paloaltoarp):
mock_response = Mock(spec=Response)
mock_agent = Mock(spec=Agent)
mock_agent.request.return_value = defer.succeed(mock_response)
Expand Down

0 comments on commit c56ef5e

Please sign in to comment.