Commit 2f0a4861 authored by Linus Pithan's avatar Linus Pithan
Browse files

faulty calc motor for tests and extend test_umv_typecheck

parent 4f3b1a59
Pipeline #37435 failed with stages
in 82 minutes and 2 seconds
...@@ -821,3 +821,11 @@ class llangle_mockup(CalcController): ...@@ -821,3 +821,11 @@ class llangle_mockup(CalcController):
rz = np.where(valid, angle - bend_offset, angle) rz = np.where(valid, angle - bend_offset, angle)
calc_dict = {"bend": bend, "ty": ty, "rz": rz} calc_dict = {"bend": bend, "ty": ty, "rz": rz}
return calc_dict return calc_dict
class FaultyCalc(CalcController):
def calc_from_real(self, positions_dict):
return {"calc_mot": None}
def calc_to_real(self, positions_dict):
return {self._axis_tag(x): None for x in self.reals}
...@@ -216,8 +216,9 @@ def execute_in_subprocess(command): ...@@ -216,8 +216,9 @@ def execute_in_subprocess(command):
return output.decode(), err.decode(), returncode return output.decode(), err.decode(), returncode
def test_umv_typecheck(session): def test_umv_typecheck(default_session):
m0 = session.env_dict["m0"] m0 = default_session.config.get("m0")
calc_mot5 = default_session.config.get("calc_mot5")
umv(m0, 1.2) umv(m0, 1.2)
with pytest.raises(RuntimeError): with pytest.raises(RuntimeError):
...@@ -226,6 +227,8 @@ def test_umv_typecheck(session): ...@@ -226,6 +227,8 @@ def test_umv_typecheck(session):
umv(1, m0) umv(1, m0)
with pytest.raises(RuntimeError): with pytest.raises(RuntimeError):
umv() umv()
with pytest.raises(TypeError):
umv(calc_mot5, 1)
def test_umv_signature(session): def test_umv_signature(session):
......
...@@ -316,3 +316,10 @@ hooks: ...@@ -316,3 +316,10 @@ hooks:
module: motors.mockup module: motors.mockup
post_move_error: true post_move_error: true
- class: FaultyCalc
module: mockup
axes:
- name: $roby
tags: real real_mot
- name: calc_mot5
tags: calc_mot
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