Skip to content

Commit

Permalink
Fix mock object properties
Browse files Browse the repository at this point in the history
  • Loading branch information
stveit authored and lunkwill42 committed Dec 14, 2023
1 parent e4985c1 commit 878c201
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unittests/portadmin/portadmin_poe_cisco_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ class TestGetPoeState:
@pytest.mark.usefixtures('poeport_get_mock')
def test_should_raise_exception_if_unknown_poe_state(self, handler_cisco):
handler_cisco._query_netbox = Mock(return_value=76)
interface = Mock(interface="interface")
interface = Mock(ifname="interface")
with pytest.raises(POEStateNotSupportedError):
handler_cisco.get_poe_states([interface])

@pytest.mark.usefixtures('poeport_get_mock_error')
def test_dict_should_give_none_if_interface_does_not_have_poeport(
self, handler_cisco
):
interface = Mock(interface="interface")
interface = Mock(ifname="interface")
states = handler_cisco.get_poe_states([interface])
assert states[interface.ifname] is None

Expand All @@ -40,7 +40,7 @@ def test_dict_should_give_none_if_interface_does_not_support_poe(
self, handler_cisco
):
handler_cisco._query_netbox = Mock(return_value=None)
interface = Mock(interface="interface")
interface = Mock(ifname="interface")
states = handler_cisco.get_poe_states([interface])
assert states[interface.ifname] is None

Expand Down

0 comments on commit 878c201

Please sign in to comment.