test: add ttest for on_destroy hook

This commit is contained in:
2025-06-05 14:38:43 +02:00
committed by Christian Appel
parent b328f064f2
commit b4316a07de

View File

@ -89,6 +89,15 @@ def test_on_stage_hook(device):
mock_on_stage.assert_called_once()
def test_on_destroy_hook(device):
"""Test on destroy hook"""
assert device.destroyed is False
with mock.patch.object(device, "on_destroy") as mock_on_destroy:
device.destroy()
mock_on_destroy.assert_called_once()
assert device.destroyed is True
def test_on_unstage_hook(device):
"""Test user method hooks"""
with mock.patch.object(device, "on_unstage") as mock_on_unstage: