mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -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
|
||||
@@ -10,12 +11,7 @@ from awx.main.models import Organization, Team
|
||||
def test_create_team(run_module, admin_user):
|
||||
org = Organization.objects.create(name='foo')
|
||||
|
||||
result = run_module('tower_team', {
|
||||
'name': 'foo_team',
|
||||
'description': 'fooin around',
|
||||
'state': 'present',
|
||||
'organization': 'foo'
|
||||
}, admin_user)
|
||||
result = run_module('tower_team', {'name': 'foo_team', 'description': 'fooin around', 'state': 'present', 'organization': 'foo'}, admin_user)
|
||||
|
||||
team = Team.objects.filter(name='foo_team').first()
|
||||
|
||||
@@ -33,18 +29,10 @@ def test_create_team(run_module, admin_user):
|
||||
@pytest.mark.django_db
|
||||
def test_modify_team(run_module, admin_user):
|
||||
org = Organization.objects.create(name='foo')
|
||||
team = Team.objects.create(
|
||||
name='foo_team',
|
||||
organization=org,
|
||||
description='flat foo'
|
||||
)
|
||||
team = Team.objects.create(name='foo_team', organization=org, description='flat foo')
|
||||
assert team.description == 'flat foo'
|
||||
|
||||
result = run_module('tower_team', {
|
||||
'name': 'foo_team',
|
||||
'description': 'fooin around',
|
||||
'organization': 'foo'
|
||||
}, admin_user)
|
||||
result = run_module('tower_team', {'name': 'foo_team', 'description': 'fooin around', 'organization': 'foo'}, admin_user)
|
||||
team.refresh_from_db()
|
||||
result.pop('invocation')
|
||||
assert result == {
|
||||
@@ -54,13 +42,6 @@ def test_modify_team(run_module, admin_user):
|
||||
assert team.description == 'fooin around'
|
||||
|
||||
# 2nd modification, should cause no change
|
||||
result = run_module('tower_team', {
|
||||
'name': 'foo_team',
|
||||
'description': 'fooin around',
|
||||
'organization': 'foo'
|
||||
}, admin_user)
|
||||
result = run_module('tower_team', {'name': 'foo_team', 'description': 'fooin around', 'organization': 'foo'}, admin_user)
|
||||
result.pop('invocation')
|
||||
assert result == {
|
||||
"id": team.id,
|
||||
"changed": False
|
||||
}
|
||||
assert result == {"id": team.id, "changed": False}
|
||||
|
||||
Reference in New Issue
Block a user