Skip to content

Commit

Permalink
Remove duplicate test
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Jan 20, 2023
1 parent 5d38055 commit 570e41e
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions tests/integration/eventengine/upgrade_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,6 @@
from nav.models.event import EventQueue as Event


def test_upgrade_handler_should_copy_old_and_new_version_to_alert_history_if_they_exist(
netbox_having_sw_upgrade,
):
fake_engine = Mock()
fake_event = Event(
source_id="ipdevpoll",
target_id="eventEngine",
event_type_id="deviceNotice",
netbox=netbox_having_sw_upgrade,
state=Event.STATE_STATELESS,
)
fake_event.varmap = {
"old_version": "old version",
"new_version": "new version",
"alerttype": "deviceSwUpgrade",
}
fake_event.save()
plugin = UpgradeHandler(fake_event, fake_engine)
plugin.handle()

alert = (
netbox_having_sw_upgrade.alerthistory_set.filter(event_type__id="deviceNotice")
.filter(variables__isnull=False)
.first()
)
assert alert, "no alert was posted on software upgrade"
variables = alert.variables.all()
assert variables.get(variable="old_version").value == "old version"
assert variables.get(variable="new_version").value == "new version"


def test_upgrade_handler_should_copy_old_and_new_version_to_alert_history_if_they_exist(
netbox_having_sw_upgrade,
):
Expand Down

0 comments on commit 570e41e

Please sign in to comment.