Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stveit committed Nov 6, 2023
1 parent d51b62e commit 56511ac
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/unittests/portadmin/napalm/juniper_poe_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ def test_returns_correct_states_if_input_has_multiple_interfaces(
assert return_dict[interface1_mock.ifname] == Juniper.POE_ENABLED
assert return_dict[interface2_mock.ifname] == Juniper.POE_DISABLED

def test_returns_none_for_single_interface_that_does_not_support_poe(
self, handler_mock, interface1_mock
):
handler_mock._get_single_poe_state = Mock(side_effect=POENotSupportedError)
return_dict = handler_mock.get_poe_states([interface1_mock])
assert return_dict[interface1_mock.ifname] is None

def test_returns_none_for_multiple_interfaces_that_does_not_support_poe(
self, handler_mock, interface1_mock, interface2_mock, xml_empty
):
handler_mock._get_all_poe_interface_information = Mock(return_value=xml_empty)
return_dict = handler_mock.get_poe_states([interface1_mock, interface2_mock])
assert return_dict[interface1_mock.ifname] is None
assert return_dict[interface2_mock.ifname] is None


class TestGetSinglePoeState:
def test_returns_correct_state_for_interface_that_exists_in_xml_response(
Expand Down

0 comments on commit 56511ac

Please sign in to comment.