mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
make flake8 happy
This commit is contained in:
parent
81205d37dc
commit
4f907c6645
@ -15,7 +15,6 @@ from django.conf import settings
|
||||
from django.core.management.base import NoArgsCommand
|
||||
from django.db import transaction, DatabaseError
|
||||
from django.utils.dateparse import parse_datetime
|
||||
from django.utils.timezone import now
|
||||
from django.utils.tzinfo import FixedOffset
|
||||
from django.db import connection
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@ from threading import Thread
|
||||
# Django
|
||||
from django.conf import settings
|
||||
from django.core.management.base import NoArgsCommand
|
||||
from django.utils.timezone import now
|
||||
|
||||
# AWX
|
||||
import awx
|
||||
|
||||
@ -11,7 +11,6 @@ import time
|
||||
# Django
|
||||
from django.conf import settings
|
||||
from django.core.management.base import NoArgsCommand
|
||||
from django.utils.timezone import now
|
||||
|
||||
# AWX
|
||||
from awx.main.models import * # noqa
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
import hmac
|
||||
import json
|
||||
import logging
|
||||
import re
|
||||
|
||||
# Django
|
||||
from django.conf import settings
|
||||
|
||||
@ -323,8 +323,8 @@ class BaseTestMixin(QueueTestMixin):
|
||||
job_template = self.make_job_template(created_by=created_by)
|
||||
|
||||
opts = {
|
||||
'created_by': created_by,
|
||||
'status': inital_state,
|
||||
'created_by': created_by,
|
||||
'status': inital_state,
|
||||
}
|
||||
opts.update(kwargs)
|
||||
return job_template.create_job(**opts)
|
||||
@ -448,9 +448,13 @@ class BaseTestMixin(QueueTestMixin):
|
||||
elif response['Content-Type'].startswith('application/yaml'):
|
||||
obj = yaml.safe_load(response.content)
|
||||
elif response['Content-Type'].startswith('text/plain'):
|
||||
obj = { 'content': response.content }
|
||||
obj = {
|
||||
'content': response.content
|
||||
}
|
||||
elif response['Content-Type'].startswith('text/html'):
|
||||
obj = { 'content': response.content }
|
||||
obj = {
|
||||
'content': response.content
|
||||
}
|
||||
else:
|
||||
self.fail('Unsupport response content type %s' % response['Content-Type'])
|
||||
else:
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
from jobs_monolithic import *
|
||||
from survey_password import *
|
||||
from base import *
|
||||
from awx.main.tests.jobs.jobs_monolithic import * # noqa
|
||||
from survey_password import * # noqa
|
||||
from base import * # noqa
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
import json
|
||||
|
||||
# Django
|
||||
import django.test
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
# AWX
|
||||
@ -91,32 +90,32 @@ TEST_SINGLE_PASSWORDS = [
|
||||
{
|
||||
'description': 'Single instance with a . after',
|
||||
'text' : 'See spot. See spot run. See spot run %s. That is a fast run.' % PASSWORD,
|
||||
'passwords': [ PASSWORD ],
|
||||
'passwords': [PASSWORD],
|
||||
'occurances': 1,
|
||||
},
|
||||
{
|
||||
'description': 'Single instance with , after',
|
||||
'text': 'Spot goes %s, at a fast pace' % PASSWORD,
|
||||
'passwords': [ PASSWORD ],
|
||||
'passwords': [PASSWORD],
|
||||
'occurances': 1,
|
||||
},
|
||||
{
|
||||
'description': 'Single instance with a space after',
|
||||
'text': 'Is %s very fast?' % PASSWORD,
|
||||
'passwords': [ PASSWORD ],
|
||||
'passwords': [PASSWORD],
|
||||
'occurances': 1,
|
||||
},
|
||||
{
|
||||
'description': 'Many instances, also with newline',
|
||||
'text': 'I think %s is very very fast. If I ran %s for 4 hours how many hours would I run?.\nTrick question. %s for 4 hours would result in running for 4 hours' % (PASSWORD, PASSWORD, PASSWORD),
|
||||
'passwords': [ PASSWORD ],
|
||||
'passwords': [PASSWORD],
|
||||
'occurances': 3,
|
||||
},
|
||||
]
|
||||
passwd = 'my!@#$%^pass&*()_+'
|
||||
TEST_SINGLE_PASSWORDS.append({
|
||||
'description': 'password includes characters not in a-z 0-9 range',
|
||||
'passwords': [ passwd ],
|
||||
'passwords': [passwd],
|
||||
'text': 'Text is fun yeah with passwords %s.' % passwd,
|
||||
'occurances': 1
|
||||
})
|
||||
|
||||
@ -13,7 +13,6 @@ import unittest
|
||||
|
||||
# Django
|
||||
from django.conf import settings
|
||||
from django.test.utils import override_settings
|
||||
from django.utils.timezone import now
|
||||
|
||||
# Django-CRUM
|
||||
|
||||
@ -75,4 +75,4 @@ class UnifiedJobStdoutRedactedTests(BaseLiveServerTest, QueueStartStopTestMixin)
|
||||
self._test_redaction_enabled('html')
|
||||
|
||||
def test_redaction_enabled_txt(self):
|
||||
self._test_redaction_enabled('txt')
|
||||
self._test_redaction_enabled('txt')
|
||||
|
||||
2
setup.cfg
Normal file → Executable file
2
setup.cfg
Normal file → Executable file
@ -18,4 +18,4 @@ exclude=awx/lib/site-packages,awx/ui,awx/api/urls.py,awx/main/migrations,awx/mai
|
||||
|
||||
[flake8]
|
||||
ignore=E201,E203,E221,E225,E231,E241,E251,E261,E265,E302,E303,E501,W291,W391,W293,E731
|
||||
exclude=awx/lib/site-packages,awx/ui,awx/api/urls.py,awx/main/migrations,awx/main/tests/data
|
||||
exclude=awx/lib/site-packages,awx/ui,awx/api/urls.py,awx/main/migrations,awx/main/tests/data,node_modules/,awx/projects/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user