mirror of
https://github.com/ansible/awx.git
synced 2026-07-31 09:59:55 -02:30
remove update_on_project_update from InventorySource
This commit is contained in:
@@ -69,21 +69,21 @@ class TestJobTemplateLabelList:
|
||||
|
||||
class TestInventoryInventorySourcesUpdate:
|
||||
@pytest.mark.parametrize(
|
||||
"can_update, can_access, is_source, is_up_on_proj, expected",
|
||||
"can_update, can_access, is_source, expected",
|
||||
[
|
||||
(True, True, "ec2", False, [{'status': 'started', 'inventory_update': 1, 'inventory_source': 1}]),
|
||||
(False, True, "gce", False, [{'status': 'Could not start because `can_update` returned False', 'inventory_source': 1}]),
|
||||
(True, False, "scm", True, [{'status': 'started', 'inventory_update': 1, 'inventory_source': 1}]),
|
||||
(True, True, "ec2", [{'status': 'started', 'inventory_update': 1, 'inventory_source': 1}]),
|
||||
(False, True, "gce", [{'status': 'Could not start because `can_update` returned False', 'inventory_source': 1}]),
|
||||
(True, False, "scm", [{'status': 'started', 'inventory_update': 1, 'inventory_source': 1}]),
|
||||
],
|
||||
)
|
||||
def test_post(self, mocker, can_update, can_access, is_source, is_up_on_proj, expected):
|
||||
def test_post(self, mocker, can_update, can_access, is_source, expected):
|
||||
class InventoryUpdate:
|
||||
id = 1
|
||||
|
||||
class Project:
|
||||
name = 'project'
|
||||
|
||||
InventorySource = namedtuple('InventorySource', ['source', 'update_on_project_update', 'pk', 'can_update', 'update', 'source_project'])
|
||||
InventorySource = namedtuple('InventorySource', ['source', 'pk', 'can_update', 'update', 'source_project'])
|
||||
|
||||
class InventorySources(object):
|
||||
def all(self):
|
||||
@@ -92,7 +92,6 @@ class TestInventoryInventorySourcesUpdate:
|
||||
pk=1,
|
||||
source=is_source,
|
||||
source_project=Project,
|
||||
update_on_project_update=is_up_on_proj,
|
||||
can_update=can_update,
|
||||
update=lambda: InventoryUpdate,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user