use standard type string algorithm in scheduler

This commit is contained in:
AlanCoding
2017-08-05 22:38:35 -04:00
parent d8abe2f38c
commit 59249d013b
2 changed files with 25 additions and 18 deletions

View File

@@ -8,6 +8,15 @@ from uuid import uuid4
from awx.main.utils import common
from awx.main.models import (
Job,
AdHocCommand,
InventoryUpdate,
ProjectUpdate,
SystemJob,
WorkflowJob
)
@pytest.mark.parametrize('input_, output', [
({"foo": "bar"}, {"foo": "bar"}),
@@ -27,3 +36,16 @@ def test_set_environ():
assert set(os.environ.keys()) - set(old_environ.keys()) == set([key])
assert os.environ == old_environ
assert key not in os.environ
# Cases relied on for scheduler dependent jobs list
@pytest.mark.parametrize('model,name', [
(Job, 'job'),
(AdHocCommand, 'ad_hoc_command'),
(InventoryUpdate, 'inventory_update'),
(ProjectUpdate, 'project_update'),
(SystemJob, 'system_job'),
(WorkflowJob, 'workflow_job')
])
def test_get_type_for_model(model, name):
assert common.get_type_for_model(model) == name