Test calculator commands
Checklist
-
I have read the contribution guidelines. -
Unit tests have been added for any new or changed code, and the test suite passes. Note: Your request will likely not be merged without the appropriate tests. -
"closes #XXXX" is in the body of the MR description to link the related issue, if applicable.
This depends on !3140 (merged).
This adds a test for as many calculators as possible which mocks subprocess.Popen
so we can see what they really do. What they really do is not pretty, but we'll cover a lot of code this way (not very well, but it's something) and be able to deprecate/change things without the risk of crashing input generation.
The test tests three things for all-ish legacy FileIOCalculators and some other calculators that have commands:
- Test that we can set the command using envvar
- Test that we can set the command via keyword
- Test that we can not set the command and get either a default command or a specific kind of failure
The test was written to pass for a commit before merging the new config stuff, then master was merged into it, and then hacks have been added so as to make the tests pass again. There is a number of compatibility-restoring hacks here and there.
This means the tested behaviours (except in a small set of cases) will be unchanged wrt. legacy behaviour.