Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
miaow2 committed Oct 24, 2023
1 parent 2d090a4 commit 6104ebd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing_extensions import Unpack

from netbox_config_diff.compliance.base import ConfigDiffBase
from netbox_config_diff.compliance.models import DeviceDataClass
from netbox_config_diff.models import ConplianceDeviceDataClass
from tests.factories import DataSourceFactory


Expand Down Expand Up @@ -97,6 +97,6 @@ def factory(**fields: Unpack["DeviceDataClassData"]) -> "DeviceDataClassData":


@pytest.fixture()
def devicedataclass_data(devicedataclass_factory: "DeviceDataClassDataFactory") -> DeviceDataClass:
def devicedataclass_data(devicedataclass_factory: "DeviceDataClassDataFactory") -> ConplianceDeviceDataClass:
data = devicedataclass_factory()
return DeviceDataClass(**data)
return ConplianceDeviceDataClass(**data)
5 changes: 2 additions & 3 deletions tests/test_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
from dcim.models import Device
from utilities.exceptions import AbortScript

from netbox_config_diff.compliance.models import DeviceDataClass
from netbox_config_diff.models import ConfigCompliance
from netbox_config_diff.models import ConfigCompliance, ConplianceDeviceDataClass
from tests.factories import ConfigComplianceFactory, DeviceFactory, PlatformSettingFactory

if TYPE_CHECKING:
Expand Down Expand Up @@ -144,7 +143,7 @@ def test_devicedataclass_to_db(
devicedataclass_factory: "DeviceDataClassDataFactory", diff: str, error: str, status: str
) -> None:
data = devicedataclass_factory(**{"diff": diff, "error": error})
d = DeviceDataClass(**data)
d = ConplianceDeviceDataClass(**data)

assert d.to_db() == {
"device_id": d.pk,
Expand Down

0 comments on commit 6104ebd

Please sign in to comment.