Commit d6ef5ba9 authored by Benoit Formet's avatar Benoit Formet Committed by Matias Guijarro
Browse files

test_standard: test umv output

parent 524ba28c
...@@ -246,13 +246,36 @@ def capture_output_patch(): ...@@ -246,13 +246,36 @@ def capture_output_patch():
builtins.print = orig_print builtins.print = orig_print
@pytest.mark.xfail() OUTPUT_UMV_ROBY = """
def test_umv_shell(capfd, default_session, capture_output_patch): roby
\x1b[Fuser 0.000
dial 0.000\x1b[Fuser 1.000
dial 1.000
"""
OUTPUT_UMV_CALC_MOT2 = """
calc_mot2[keV] calc_mot1[keV] roby
\x1b[Fuser 4.000 2.000 1.000
dial 4.000 2.000 1.000\x1b[Fuser 4.000 2.000 1.000
dial 4.000 2.000 1.000
"""
def test_umv_shell(capfd, default_session):
roby = default_session.config.get("roby") roby = default_session.config.get("roby")
umv(roby, 1) umv(roby, 1)
output = capfd.readouterr().out.splitlines() output = capfd.readouterr().out
# first 3 items are: empty line, motor name, empty line assert output == OUTPUT_UMV_ROBY
assert all(x != "" for x in output[3:])
calc_mot2 = default_session.config.get("calc_mot2")
umv(calc_mot2, 4)
output = capfd.readouterr().out
assert output == OUTPUT_UMV_CALC_MOT2
default_session.config.get("calc_mot1").controller.close()
calc_mot2.controller.close()
def test_umvr_lib_mode(capsys, default_session): def test_umvr_lib_mode(capsys, default_session):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment