mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2025-06-13 23:07:15 +02:00
test: add ttest for on_destroy hook
This commit is contained in:
@ -89,6 +89,15 @@ def test_on_stage_hook(device):
|
|||||||
mock_on_stage.assert_called_once()
|
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):
|
def test_on_unstage_hook(device):
|
||||||
"""Test user method hooks"""
|
"""Test user method hooks"""
|
||||||
with mock.patch.object(device, "on_unstage") as mock_on_unstage:
|
with mock.patch.object(device, "on_unstage") as mock_on_unstage:
|
||||||
|
Reference in New Issue
Block a user