mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Make test_git functional in TestRunner.py
This commit is contained in:
parent
87b3e1ecdc
commit
90bf67cf56
1 changed files with 17 additions and 2 deletions
|
@ -9,6 +9,7 @@ import ansible.runner
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import time
|
import time
|
||||||
|
import tempfile
|
||||||
try:
|
try:
|
||||||
import json
|
import json
|
||||||
except:
|
except:
|
||||||
|
@ -188,8 +189,22 @@ class TestRunner(unittest.TestCase):
|
||||||
assert 'failed' not in result
|
assert 'failed' not in result
|
||||||
|
|
||||||
def test_git(self):
|
def test_git(self):
|
||||||
# TODO: tests for the git module
|
if not get_binary("yum"):
|
||||||
pass
|
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):
|
def test_service(self):
|
||||||
# TODO: tests for the service module
|
# TODO: tests for the service module
|
||||||
|
|
Loading…
Reference in a new issue