mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 23:21:22 -07:00
Some tweaks to the fetch module. 'err' return was for stderr, so that should be empty string.
Some minor code shortening. Added a test to TestRunner.
This commit is contained in:
parent
62224271e9
commit
245aa9bf8e
2 changed files with 17 additions and 22 deletions
|
@ -189,6 +189,14 @@ class TestRunner(unittest.TestCase):
|
|||
assert 'stdout' in result
|
||||
assert result['ansible_job_id'] == jid
|
||||
|
||||
def test_fetch(self):
|
||||
input = self._get_test_file('sample.j2')
|
||||
output = self._get_stage_file('127.0.0.2/sample.j2')
|
||||
result = self._run('fetch', [ "src=%s" % input, "dest=%s" % self.stage_dir ])
|
||||
print "output file=%s" % output
|
||||
assert os.path.exists(output)
|
||||
assert open(input).read() == open(output).read()
|
||||
|
||||
def test_yum(self):
|
||||
result = self._run('yum', [ "list=repos" ])
|
||||
assert 'failed' not in result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue