As a general comment, there are hundreds of lines that repeat every five or ten lines, doing the same thing over and over again. It would probably help a lot in terms of the maintainability of the tests if there were a table containing the inputs and outputs. In that case, there would be the table (easy to read, one line per test), and something like ten or twenty lines of code for the single test that runs through the table.
As a general comment, there are hundreds of lines that repeat every five or ten lines, doing the same thing over and over again. It would probably help a lot in terms of the maintainability of the tests if there were a table containing the inputs and outputs. In that case, there would be the table (easy to read, one line per test), and something like ten or twenty lines of code for the single test that runs through the table.