summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStephen Fromm <sfromm@gmail.com>2012-07-29 22:40:12 -0700
committerStephen Fromm <sfromm@gmail.com>2012-07-29 22:40:12 -0700
commit90bf67cf56a6ad6ac666cacd1f5ce0acd1fc47e3 (patch)
tree9561370d39a09484599394c0ec2c6a1bb733b583 /test
parent87b3e1ecdca95098e4c8dc8b8f545fbeeec80710 (diff)
downloadansible-90bf67cf56a6ad6ac666cacd1f5ce0acd1fc47e3.tar.gz
Make test_git functional in TestRunner.py
Diffstat (limited to 'test')
-rw-r--r--test/TestRunner.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/TestRunner.py b/test/TestRunner.py
index ed429683ed..aa7d82734b 100644
--- a/test/TestRunner.py
+++ b/test/TestRunner.py
@@ -9,6 +9,7 @@ import ansible.runner
import os
import shutil
import time
+import tempfile
try:
import json
except:
@@ -188,8 +189,22 @@ class TestRunner(unittest.TestCase):
assert 'failed' not in result
def test_git(self):
- # TODO: tests for the git module
- pass
+ if not get_binary("yum"):
+ raise SkipTest
+ repo = 'git://github.com/ansible/ansible.git'
+ dest = tempfile.mkdtemp()
+ result = self._run('git', ['repo=%s' % repo, 'dest=%s' % dest])
+ assert 'failed' not in result
+ result = self._run('git', [
+ 'repo=%s' % repo,
+ 'dest=%s' % dest,
+ 'version=master'
+ ])
+ assert 'false' not in result
+ try:
+ shutil.rmtree(dest)
+ except OSError, e:
+ print "Failed to remove temp dir %s" % dest
def test_service(self):
# TODO: tests for the service module