Open RadeKornjaca opened 4 years ago
I fully agree that student CLI argument parsing ought to be tested as well. To be honest, I'm not sure why I didn't consider it myself (probably ran out of coffee).
Some thoughts/questions:
expected-returncode
test fixture data.smoke_test
class hierarchy, would you suggest we subclass for these tests? My gut feeling is that we don't really need this feature within the smoke_test.tests.functional.stdio
module.[0..N-1, N+1, N+2]
CLI arguments, where N
is the correct number of CLI arguments.stdout
/stderr
out of this issue, if you look at https://github.com/petarmaric/smoke_test/blob/1.0.1/smoke_test/tests/functional/file.py#L59 you'll see that the BaseFileErrorHandlingTest
class and its descendants (FileErrorInputNotReadableTest
and FileErrorOutputNotWritableTest
) ignore stdout
output and focus on expected-returncode
exclusively. This is intentional, as from my experience you can't rely upon students to honor error message formatting.
Currently, the number of arguments that are provided in the example code match the "happy path" scenario. Using already provided mechanisms, add data fixture that will:
Example for the code from example directory (not necessarily 100% correct):
In case of accepting the #2, add the according
stderr
output to the fixture.