Fix up unit tests after tower to controller rename

This commit is contained in:
Alan Rominger
2021-06-17 13:43:52 -04:00
committed by Shane McDonald
parent b64c2d6861
commit 8c1bc97c2f
6 changed files with 10 additions and 10 deletions

View File

@@ -104,7 +104,7 @@ class TestActiveCount:
def test_active_count_minus_tower(self, inventory):
inventory.hosts.create(name='locally-managed-host')
source = inventory.inventory_sources.create(name='tower-source', source='tower')
source = inventory.inventory_sources.create(name='tower-source', source='controller')
source.hosts.create(name='remotely-managed-host', inventory=inventory)
assert Host.objects.active_count() == 1
@@ -210,7 +210,7 @@ class TestInventorySourceInjectors:
('rhv', 'ovirt.ovirt.ovirt'),
('satellite6', 'theforeman.foreman.foreman'),
('insights', 'redhatinsights.insights.insights'),
('tower', 'awx.awx.tower'),
('controller', 'awx.awx.tower'),
],
)
def test_plugin_proper_names(self, source, proper_name):

View File

@@ -62,7 +62,7 @@ def fake_credential_factory():
for var in var_specs.keys():
inputs[var] = generate_fake_var(var_specs[var])
if source == 'tower':
if source == 'controller':
inputs.pop('oauth_token') # mutually exclusive with user/pass
return Credential.objects.create(credential_type=ct, inputs=inputs)

View File

@@ -1778,8 +1778,8 @@ class TestInventoryUpdateCredentials(TestJobExecution):
def test_tower_source(self, verify, inventory_update, private_data_dir, mocker):
task = tasks.RunInventoryUpdate()
task.instance = inventory_update
tower = CredentialType.defaults['tower']()
inventory_update.source = 'tower'
tower = CredentialType.defaults['controller']()
inventory_update.source = 'controller'
inputs = {'host': 'https://tower.example.org', 'username': 'bob', 'password': 'secret', 'verify_ssl': verify}
def get_cred():
@@ -1806,8 +1806,8 @@ class TestInventoryUpdateCredentials(TestJobExecution):
def test_tower_source_ssl_verify_empty(self, inventory_update, private_data_dir, mocker):
task = tasks.RunInventoryUpdate()
task.instance = inventory_update
tower = CredentialType.defaults['tower']()
inventory_update.source = 'tower'
tower = CredentialType.defaults['controller']()
inventory_update.source = 'controller'
inputs = {
'host': 'https://tower.example.org',
'username': 'bob',