Skip to content

Commit bff1d6f

Browse files
Add test for string import
1 parent b9c7a26 commit bff1d6f

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tests/devices/unit_tests/test_utils.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
from unittest.mock import patch
1+
from unittest.mock import MagicMock, patch
2+
3+
from bluesky.protocols import Readable
4+
from ophyd import EpicsMotor
25

36
from dodal.utils import collect_factories, get_hostname, make_all_devices
47

@@ -20,7 +23,20 @@ def test_makes_devices() -> None:
2023
assert {"readable", "motor", "cryo"} == devices.keys()
2124

2225

26+
def test_makes_devices_with_module_name() -> None:
27+
devices = make_all_devices("tests.fake_beamline")
28+
assert {"readable", "motor", "cryo"} == devices.keys()
29+
30+
2331
def test_get_hostname() -> None:
2432
with patch("dodal.utils.socket.gethostname") as mock:
2533
mock.return_value = "a.b.c"
2634
assert get_hostname() == "a"
35+
36+
37+
def device_a() -> Readable:
38+
return MagicMock()
39+
40+
41+
def device_b() -> EpicsMotor:
42+
return MagicMock()

0 commit comments

Comments
 (0)