Update callback plugin to use API, remove inventory/callback management commands.

This commit is contained in:
Chris Church
2013-06-20 12:44:51 -04:00
parent 59d1ae7322
commit 1d3bd62bd2
13 changed files with 80 additions and 681 deletions

View File

@@ -7,7 +7,7 @@ import tempfile
from django.conf import settings
from django.test.utils import override_settings
from ansibleworks.main.models import *
from ansibleworks.main.tests.base import BaseTransactionTest, BaseLiveServerTest
from ansibleworks.main.tests.base import BaseLiveServerTest
from ansibleworks.main.tasks import RunJob
TEST_PLAYBOOK = '''- hosts: test-group
@@ -90,7 +90,7 @@ TEST_SSH_KEY_DATA_UNLOCK = 'unlockme'
@override_settings(CELERY_ALWAYS_EAGER=True,
CELERY_EAGER_PROPAGATES_EXCEPTIONS=True)
class BaseCeleryTest(BaseLiveServerTest):#BaseTransactionTest):
class BaseCeleryTest(BaseLiveServerTest):
'''
Base class for celery task tests.
'''
@@ -116,8 +116,6 @@ class RunJobTest(BaseCeleryTest):
self.group.hosts.add(self.host)
self.project = None
self.credential = None
# Pass test database name in environment for use by the inventory script.
os.environ['ACOM_TEST_DATABASE_NAME'] = settings.DATABASES['default']['NAME']
# Monkeypatch RunJob to capture list of command line arguments.
self.original_build_args = RunJob.build_args
self.run_job_args = None
@@ -132,7 +130,6 @@ class RunJobTest(BaseCeleryTest):
def tearDown(self):
super(RunJobTest, self).tearDown()
os.environ.pop('ACOM_TEST_DATABASE_NAME', None)
if self.test_project_path:
shutil.rmtree(self.test_project_path, True)
RunJob.build_args = self.original_build_args