This fixes the following when running `python tests/runtests.py --ext-pillar`:
-------- Tests with Errors ------------------------------------------------------------------------------------------------------------------------
-> tearDownClass (integration.pillar.test_git_pillar.TestGitPythonSSH) ...........................................................................
Traceback (most recent call last):
File ".../salt/tests/support/gitfs.py", line 481, in tearDownClass
if cls.case.sshd_proc is not None:
AttributeError: 'NoneType' object has no attribute 'sshd_proc'
...................................................................................................................................................
-> tearDownClass (integration.pillar.test_git_pillar.TestPygit2SSH) ..............................................................................
Traceback (most recent call last):
File ".../salt/tests/support/gitfs.py", line 481, in tearDownClass
if cls.case.sshd_proc is not None:
AttributeError: 'NoneType' object has no attribute 'sshd_proc'
...................................................................................................................................................
-----------------------------------------------------------------------------------------------------------------------------------------------------
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
(cherry picked from commit 84e9fce9bb)
The proxy and ssh tests won't run when the `--proxy` and `--ssh` CLI
flags, respectively, aren't passed to runtests.py. This ensures that we
start the daemons when the file mapping logic triggers them to be run.
This commit begins to go over the existing testing for mac_utils,
applying the updated best-practices from the unit testing section of the
Salt docs.
Wherever possible, I've tried to keep the data for each test within the
test, while factoring out repetitive functions. In this commit, for
example, the `os.walk` side_effect func has been factored into its own
helper function.
This commit begins looking at what is being tested for this module and
making it more specific, specifically to test one thing per test
(existing tests had multiple asserts and in some casaes were actually
malformed such that the tests would pass, but in actual use, code would
throw an exception and skip over the block).