Skip to content

Commit 4ed8491

Browse files
Test if labels are transferred to the response and we can still relabel them
1 parent 1977dbb commit 4ed8491

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

control/tests/trdata_test.py

Lines changed: 8 additions & 6 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy