Skip to content

Commit

Permalink
Fix profile fixture
Browse files Browse the repository at this point in the history
The profile fixture returned a mocked management profile object that
was incomplete.  The new SNMP setup routines inspect the profile
configuration more closely, and would fail.  There is no need to use
a Mock to mock a profile, just create an instance with an actual
configuration dict, but just don't save it anywhere.
  • Loading branch information
lunkwill42 committed Nov 16, 2023
1 parent d028681 commit 9ca27c5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/unittests/portadmin/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
import pytest

from nav.enterprise.ids import VENDOR_ID_HEWLETT_PACKARD, VENDOR_ID_CISCOSYSTEMS
from nav.models.manage import ManagementProfile
from nav.portadmin.management import ManagementFactory


@pytest.fixture
def profile():
profile = Mock()
profile.snmp_version = 2
profile.snmp_community = "public"
profile = ManagementProfile(
protocol=ManagementProfile.PROTOCOL_SNMP,
configuration={"version": 2, "community": "public"},
)
return profile


Expand Down

0 comments on commit 9ca27c5

Please sign in to comment.