Closed taldcroft closed 5 months ago
The docstring does not specify that, and instead uses colloquial language (Clip existing commands to the RLTT). It would have been nice to have it in the docstring).
I'll improve the docstring, that's a good point. There is already some PR cross-talk with the docstring here so I don't want to touch this now, praying to not generate merge conflicts when this gets merged.
Description
The
CommandTable.add_cmds()
method had a bug where it would update the originalself
table in place (usingremove_rows
) prior to using it for computing the new table with additional commands. I think the original idea of this method was for the whole thing to be in-place but that was inconvenient.This fixes the issue by not using
remove_rows
and defines a new reference to the original commands which is filtered NOT in-place.This also adds a careful test of the method which was previously lacking.
Interface impacts
None.
Testing
Unit tests
kadi/commands/tests/test_commands.py ..................................................................................... [ 37%] kadi/commands/tests/test_states.py ......................x.............................................x....................... [ 77%] [ 77%] kadi/commands/tests/test_validate.py .................... [ 86%] kadi/tests/test_events.py .......... [ 90%] kadi/tests/test_occweb.py ...................... [100%]
============================================= 227 passed, 2 xfailed in 143.25s (0:02:23) ==============================================