Skip to content

Commit e6ab9fe

Browse files
fixup! Test if labels are transferred to the response and we can still relabel them
1 parent 1251a68 commit e6ab9fe

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

control/tests/trdata_test.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,15 @@ def test_trdata_labels():
237237
response.input_labels, ["u[%d]" % i for i in range(sys.ninputs)])
238238

239239
# Make sure the selected input and output are both correctly transferred to the response
240-
for n,_ in enumerate(U):
241-
step_response = ct.step_response(sys, T, input=n, output=n)
242-
assert step_response.input_labels == [sys.input_labels[n]]
243-
assert step_response.output_labels == [sys.output_labels[n]]
240+
for nu in range(sys.ninputs):
241+
for ny in range(sys.noutputs):
242+
step_response = ct.step_response(sys, T, input=nu, output=ny)
243+
assert step_response.input_labels == [sys.input_labels[nu]]
244+
assert step_response.output_labels == [sys.output_labels[ny]]
245+
246+
init_response = ct.initial_response(sys, T, input=nu, output=ny)
247+
assert init_response.input_labels == None
248+
assert init_response.output_labels == [sys.output_labels[ny]]
244249

245250

246251
def test_trdata_multitrace():

0 commit comments

Comments
 (0)