Converted tower_group

Splitting out tower_inventory_source from tower_group

Copy/Paste typo fix and README update for breaking backwards compatability

Update credential_type module and unit tests
This commit is contained in:
John Westcott IV
2020-02-04 13:00:01 -05:00
committed by beeankha
parent 8a0432efb7
commit 1c505beba6
13 changed files with 81 additions and 125 deletions

View File

@@ -42,7 +42,6 @@ def sanitize_dict(din):
@pytest.fixture
def run_module(request):
# A placeholder to use while modules get converted
def rf(module_name, module_params, request_user):
def new_request(self, method, url, **kwargs):

View File

@@ -78,7 +78,6 @@ def test_create_custom_credential_type(run_module, admin_user):
ct = CredentialType.objects.get(name='Nexus')
result.pop('invocation')
result.pop('existing_credential_type')
result.pop('name')
assert result == {
"credential_type": "Nexus",

View File

@@ -25,8 +25,9 @@ def test_create_group(run_module, admin_user):
result.pop('invocation')
assert result == {
'credential_type': 'Nexus',
'id': group.id,
'group': 'Test Group',
'name': 'Test Group',
'changed': True,
'state': 'present'
}
@@ -53,7 +54,8 @@ def test_tower_group_idempotent(run_module, admin_user):
result.pop('invocation')
assert result == {
'id': group.id,
'group': 'Test Group',
'credential_type': 'Nexus',
'name': 'Test Group',
'changed': False, # idempotency assertion
'state': 'present'
}

View File

@@ -27,7 +27,6 @@ def test_create_organization(run_module, admin_user):
assert result.get('changed'), result
org = Organization.objects.get(name='foo')
result.pop('existing_credential_type')
assert result == {
"name": "foo",
"changed": True,
@@ -55,7 +54,6 @@ def test_create_organization_with_venv(run_module, admin_user, mocker):
org = Organization.objects.get(name='foo')
result.pop('invocation')
result.pop('existing_credential_type')
assert result == {
"credential_type": "Nexus",
"state": "present",

View File

@@ -23,7 +23,6 @@ def test_create_project(run_module, admin_user, organization):
assert proj.organization == organization
result.pop('invocation')
result.pop('existing_credential_type')
assert result == {
'credential_type': 'Nexus',
'state': 'present',

View File

@@ -20,7 +20,6 @@ def test_create_team(run_module, admin_user):
team = Team.objects.filter(name='foo_team').first()
result.pop('invocation')
result.pop('existing_credential_type')
assert result == {
"changed": True,
"name": "foo_team",
@@ -50,7 +49,6 @@ def test_modify_team(run_module, admin_user):
}, admin_user)
team.refresh_from_db()
result.pop('invocation')
result.pop('existing_credential_type')
assert result == {
"state": "present",
"changed": True,
@@ -67,7 +65,6 @@ def test_modify_team(run_module, admin_user):
'organization': 'foo'
}, admin_user)
result.pop('invocation')
result.pop('existing_credential_type')
assert result == {
"credential_type": "Nexus",
"name": "foo_team",