Skip to content

Commit def74af

Browse files
committed
[fix] Remove duplicate self-match assertion from test_device_update_config_in_progress
Consolidated the self-ID exclusion assertion into test_update_in_progress_ignores_current_task to avoid redundancy.
1 parent 2d23417 commit def74af

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

openwisp_controller/connection/tests/test_models.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,24 +1047,6 @@ def test_device_update_config_in_progress(
10471047
mocked_get_working_connection.assert_not_called()
10481048
update_config.assert_not_called()
10491049

1050-
# Regression: when the only active task matches the current task's own ID,
1051-
# _is_update_in_progress must return False (update should proceed).
1052-
with mock.patch("celery.app.control.Inspect.active") as mocked_active:
1053-
current_task_id = "current-task-id"
1054-
mocked_active.return_value = {
1055-
"worker1": [
1056-
{
1057-
"name": _TASK_NAME,
1058-
"args": [str(conf.device.pk)],
1059-
"id": current_task_id,
1060-
}
1061-
]
1062-
}
1063-
result = _is_update_in_progress(
1064-
conf.device.pk, current_task_id=current_task_id
1065-
)
1066-
self.assertFalse(result)
1067-
10681050
def test_update_in_progress_ignores_current_task(self):
10691051
"""Regression test: _is_update_in_progress must not match the
10701052
currently running task, which would cause it to skip itself."""

0 commit comments

Comments
 (0)