-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from yannachen/load_robot
Using config.get() to get robot
- Loading branch information
Showing
2 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import pytest | ||
from ophydregistry.exceptions import ComponentNotFound | ||
|
||
from haven.instrument import Robot, load_robot | ||
|
||
|
||
|
@@ -17,6 +20,18 @@ def test_load_robot(sim_registry): | |
assert rbt.prefix == "255idAustin" | ||
|
||
|
||
def test_load_no_robot(sim_registry): | ||
load_robot(config={}) | ||
|
||
# Test the robot is not in config | ||
result = pytest.raises(ComponentNotFound, sim_registry.findall, label="robots") | ||
|
||
# Assert that the expected exception is raised | ||
assert 'Could not find components matching: label="robots", name="None"' in str( | ||
result.value | ||
) | ||
|
||
|
||
# ----------------------------------------------------------------------------- | ||
# :author: Yanna Chen | ||
# :email: [email protected] | ||
|