Skip to content

Commit

Permalink
TST #567 differentiate these tests
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Jan 9, 2022
1 parent eb85cc3 commit 858d40e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
Binary file modified .coverage
Binary file not shown.
26 changes: 17 additions & 9 deletions apstools/devices/tests/test_xia_slit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,27 @@
# We don't have that for unit testing. Proceed with best efforts.


def test_XiaSlit(capsys):
def test_XiaSlit_not_connected():
slit1 = XiaSlitController("gp:hsc1:", name="slit1")
assert slit1 is not None

# slit1.wait_for_connection()
assert not slit1.connected


def test_XiaSlit_geometry(capsys):
slit1 = XiaSlitController("gp:hsc1:", name="slit1")

with pytest.raises(TypeError):
print(slit1.geometry)

captured = capsys.readouterr()
assert captured.out.split("\n") == [""]
assert captured.err.split("\n") == [""]


def test_XiaSlit_components():
slit1 = XiaSlitController("gp:hsc1:", name="slit1")
cns = """
inb out bot top
hsize vsize hcenter vcenter
Expand All @@ -25,11 +40,4 @@ def test_XiaSlit(capsys):
calibrate initialize locate stop_button
precision
""".split()
assert slit1.component_names == tuple(cns)

with pytest.raises(TypeError):
print(slit1.geometry)

captured = capsys.readouterr()
assert captured.out.split("\n") == [""]
assert captured.err.split("\n") == [""]
assert sorted(slit1.component_names) == sorted(cns)

0 comments on commit 858d40e

Please sign in to comment.