mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
move code linting to a stricter pep8-esque auto-formatting tool, black
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
import pytest
|
||||
@@ -12,12 +13,7 @@ def test_create_group(run_module, admin_user):
|
||||
inv = Inventory.objects.create(name='test-inv', organization=org)
|
||||
variables = {"ansible_network_os": "iosxr"}
|
||||
|
||||
result = run_module('tower_group', dict(
|
||||
name='Test Group',
|
||||
inventory='test-inv',
|
||||
variables=variables,
|
||||
state='present'
|
||||
), admin_user)
|
||||
result = run_module('tower_group', dict(name='Test Group', inventory='test-inv', variables=variables, state='present'), admin_user)
|
||||
assert result.get('changed'), result
|
||||
|
||||
group = Group.objects.get(name='Test Group')
|
||||
@@ -42,13 +38,11 @@ def test_associate_hosts_and_children(run_module, admin_user, organization):
|
||||
|
||||
child = Group.objects.create(inventory=inv, name='child_group')
|
||||
|
||||
result = run_module('tower_group', dict(
|
||||
name='Test Group',
|
||||
inventory='test-inv',
|
||||
hosts=[inv_hosts[1].name, inv_hosts[2].name],
|
||||
children=[child.name],
|
||||
state='present'
|
||||
), admin_user)
|
||||
result = run_module(
|
||||
'tower_group',
|
||||
dict(name='Test Group', inventory='test-inv', hosts=[inv_hosts[1].name, inv_hosts[2].name], children=[child.name], state='present'),
|
||||
admin_user,
|
||||
)
|
||||
assert not result.get('failed', False), result.get('msg', result)
|
||||
assert result['changed'] is True
|
||||
|
||||
@@ -62,13 +56,7 @@ def test_associate_on_create(run_module, admin_user, organization):
|
||||
child = Group.objects.create(name='test-child', inventory=inv)
|
||||
host = Host.objects.create(name='test-host', inventory=inv)
|
||||
|
||||
result = run_module('tower_group', dict(
|
||||
name='Test Group',
|
||||
inventory='test-inv',
|
||||
hosts=[host.name],
|
||||
groups=[child.name],
|
||||
state='present'
|
||||
), admin_user)
|
||||
result = run_module('tower_group', dict(name='Test Group', inventory='test-inv', hosts=[host.name], groups=[child.name], state='present'), admin_user)
|
||||
assert not result.get('failed', False), result.get('msg', result)
|
||||
assert result['changed'] is True
|
||||
|
||||
@@ -82,12 +70,7 @@ def test_children_alias_of_groups(run_module, admin_user, organization):
|
||||
inv = Inventory.objects.create(name='test-inv', organization=organization)
|
||||
group = Group.objects.create(name='Test Group', inventory=inv)
|
||||
child = Group.objects.create(inventory=inv, name='child_group')
|
||||
result = run_module('tower_group', dict(
|
||||
name='Test Group',
|
||||
inventory='test-inv',
|
||||
groups=[child.name],
|
||||
state='present'
|
||||
), admin_user)
|
||||
result = run_module('tower_group', dict(name='Test Group', inventory='test-inv', groups=[child.name], state='present'), admin_user)
|
||||
assert not result.get('failed', False), result.get('msg', result)
|
||||
assert result['changed'] is True
|
||||
|
||||
@@ -104,11 +87,7 @@ def test_tower_group_idempotent(run_module, admin_user):
|
||||
inventory=inv,
|
||||
)
|
||||
|
||||
result = run_module('tower_group', dict(
|
||||
name='Test Group',
|
||||
inventory='test-inv',
|
||||
state='present'
|
||||
), admin_user)
|
||||
result = run_module('tower_group', dict(name='Test Group', inventory='test-inv', state='present'), admin_user)
|
||||
|
||||
result.pop('invocation')
|
||||
assert result == {
|
||||
|
||||
Reference in New Issue
Block a user