Age | Commit message (Collapse) | Author |
|
This is an improvement over indirect parameterisation for a few reasons:
* The test code is much easier to read, the mark names are much more
intuitive than the indirect parameterisation invocation, and there's
less boilerplate to boot
* The fixture no longer has to overload the single parameter that
fixtures can take with multiple meanings
|
|
This was painful, but it finishes a TODO from cloudinit/subp.py.
It moves the following from util to subp:
ProcessExecutionError
subp
which
target_path
I moved subp_blob_in_tempfile into cc_chef, which is its only caller.
That saved us from having to deal with it using write_file
and temp_utils from subp (which does not import any cloudinit things now).
It is arguable that 'target_path' could be moved to a 'path_utils' or
something, but in order to use it from subp and also from utils,
we had to get it out of utils.
|
|
This allows tests to be configured to permit some commands to be run via
util.subp, while still rejecting any unexpected calls. See the
documentation for further details.
|
|
We recently discovered that pylint is failing to report some errors when
invoked across our entire codebase (see
https://github.com/PyCQA/pylint/issues/3611). I've run pylint across
every Python file under cloudinit/[0], and this commit fixes the issues
so-discovered.
[0] find cloudinit/ -name "*.py" | xargs -n 1 -t .tox/pylint/bin/python -m pylint
|
|
And raise TypeError when subp called with no args, which more accurately mirrors normal behaviour:
>>> from cloudinit.util import subp
>>> subp()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: subp() missing 1 required positional argument: 'args'
|
|
This mirrors the behaviour of CiTestCase.allowed_subp, by causing all
calls to util.subp to raise an AssertionError.
|