Skip to content

Commit 7b8db61

Browse files
Test if labels are transferred to the response and we can still relabel them
1 parent 3237c7a commit 7b8db61

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

control/tests/trdata_test.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,17 @@ def test_response_copy():
196196
with pytest.raises(ValueError, match="not enough"):
197197
t, y, x = response_mimo
198198

199-
# Labels
200-
assert response_mimo.output_labels is None
201-
assert response_mimo.state_labels is None
202-
assert response_mimo.input_labels is None
199+
# Make sure labels are transferred to the response
200+
assert response_mimo.output_labels == sys_mimo.output_labels
201+
assert response_mimo.state_labels == sys_mimo.state_labels
202+
assert response_mimo.input_labels == sys_mimo.input_labels
203+
204+
# Check relabelling
203205
response = response_mimo(
204206
output_labels=['y1', 'y2'], input_labels='u',
205-
state_labels=["x[%d]" % i for i in range(4)])
207+
state_labels=["x%d" % i for i in range(4)])
206208
assert response.output_labels == ['y1', 'y2']
207-
assert response.state_labels == ['x[0]', 'x[1]', 'x[2]', 'x[3]']
209+
assert response.state_labels == ['x0', 'x1', 'x2', 'x3']
208210
assert response.input_labels == ['u']
209211

210212
# Unknown keyword

0 commit comments

Comments
 (0)