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:
Michael DeHaan 2012-04-11 20:12:01 -04:00
commit 245aa9bf8e
2 changed files with 17 additions and 22 deletions

View file

@ -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