Skip to content

Commit

Permalink
black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrowson committed May 22, 2021
1 parent 21c3b7a commit 1a7f9f0
Show file tree
Hide file tree
Showing 29 changed files with 5,407 additions and 3,860 deletions.
5 changes: 3 additions & 2 deletions tests/data/test1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

# this is a module


def greet():
print('There is more stupidity than hydrogen in the universe, and it has a longer shelf life.')
print(
"There is more stupidity than hydrogen in the universe, and it has a longer shelf life."
)
4 changes: 2 additions & 2 deletions tests/data/test2/test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# this is a module, so test2 should get an __init__.py


def get_some_wisdom():
return 'Art is making something out of nothing, and selling it.'
return "Art is making something out of nothing, and selling it."
27 changes: 16 additions & 11 deletions tests/test_app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from zappa.asynchronous import task

try:
from urllib.parse import parse_qs
except ImportError:
Expand All @@ -11,29 +12,34 @@


def hello_world(environ, start_response):
parameters = parse_qs(environ.get('QUERY_STRING', ''))
if 'subject' in parameters:
subject = escape(parameters['subject'][0])
parameters = parse_qs(environ.get("QUERY_STRING", ""))
if "subject" in parameters:
subject = escape(parameters["subject"][0])
else:
subject = 'World'
start_response('200 OK', [('Content-Type', 'text/html')])
return ['''Hello {subject!s}
subject = "World"
start_response("200 OK", [("Content-Type", "text/html")])
return [
"""Hello {subject!s}
Hello {subject!s}!
'''.format(**{'subject': subject})]
""".format(
**{"subject": subject}
)
]


def schedule_me():
return "Hello!"


@task
def async_me(arg1, **kwargs):
return "run async when on lambda %s%s" % (arg1, kwargs.get('foo', ''))
return "run async when on lambda %s%s" % (arg1, kwargs.get("foo", ""))


@task(remote_aws_lambda_function_name='test-app-dev', remote_aws_region='us-east-1')
@task(remote_aws_lambda_function_name="test-app-dev", remote_aws_region="us-east-1")
def remote_async_me(arg1, **kwargs):
return "run async always on lambda %s%s" % (arg1, kwargs.get('foo', ''))
return "run async always on lambda %s%s" % (arg1, kwargs.get("foo", ""))


def callback(self):
Expand All @@ -42,4 +48,3 @@ def callback(self):

def prebuild_me():
print("this is a prebuild script")

20 changes: 11 additions & 9 deletions tests/test_bot_exception_handler_settings.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
API_STAGE = 'dev'
APP_FUNCTION = 'app'
APP_MODULE = 'tests.test_wsgi_script_name_app'
API_STAGE = "dev"
APP_FUNCTION = "app"
APP_MODULE = "tests.test_wsgi_script_name_app"
BINARY_SUPPORT = False
CONTEXT_HEADER_MAPPINGS = {}
DEBUG = 'True'
DEBUG = "True"
DJANGO_SETTINGS = None
DOMAIN = 'api.example.com'
DOMAIN = "api.example.com"
ENVIRONMENT_VARIABLES = {}
LOG_LEVEL = 'DEBUG'
PROJECT_NAME = 'wsgi_script_name_settings'
LOG_LEVEL = "DEBUG"
PROJECT_NAME = "wsgi_script_name_settings"
COGNITO_TRIGGER_MAPPING = {}
AWS_BOT_EVENT_MAPPING = {'intent-name:DialogCodeHook': 'tests.test_handler.raises_exception'}
EXCEPTION_HANDLER = 'tests.test_handler.mocked_exception_handler'
AWS_BOT_EVENT_MAPPING = {
"intent-name:DialogCodeHook": "tests.test_handler.raises_exception"
}
EXCEPTION_HANDLER = "tests.test_handler.mocked_exception_handler"
18 changes: 10 additions & 8 deletions tests/test_bot_handler_being_triggered.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
API_STAGE = 'dev'
APP_FUNCTION = 'app'
APP_MODULE = 'tests.test_wsgi_script_name_app'
API_STAGE = "dev"
APP_FUNCTION = "app"
APP_MODULE = "tests.test_wsgi_script_name_app"
BINARY_SUPPORT = False
CONTEXT_HEADER_MAPPINGS = {}
DEBUG = 'True'
DEBUG = "True"
DJANGO_SETTINGS = None
DOMAIN = 'api.example.com'
DOMAIN = "api.example.com"
ENVIRONMENT_VARIABLES = {}
LOG_LEVEL = 'DEBUG'
PROJECT_NAME = 'wsgi_script_name_settings'
LOG_LEVEL = "DEBUG"
PROJECT_NAME = "wsgi_script_name_settings"
COGNITO_TRIGGER_MAPPING = {}
AWS_BOT_EVENT_MAPPING = {'intent-name:DialogCodeHook': 'tests.test_handler.handle_bot_intent'}
AWS_BOT_EVENT_MAPPING = {
"intent-name:DialogCodeHook": "tests.test_handler.handle_bot_intent"
}
2 changes: 1 addition & 1 deletion tests/test_event_script_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


def handler_for_events(event, context):
print('Event:', event)
print("Event:", event)
return True
14 changes: 7 additions & 7 deletions tests/test_event_script_settings.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
API_STAGE = 'dev'
APP_FUNCTION = 'handler_for_events'
APP_MODULE = 'tests.test_event_script_app'
DEBUG = 'True'
API_STAGE = "dev"
APP_FUNCTION = "handler_for_events"
APP_MODULE = "tests.test_event_script_app"
DEBUG = "True"
DJANGO_SETTINGS = None
DOMAIN = 'api.example.com'
DOMAIN = "api.example.com"
ENVIRONMENT_VARIABLES = {}
LOG_LEVEL = 'DEBUG'
PROJECT_NAME = 'test_event_script_app'
LOG_LEVEL = "DEBUG"
PROJECT_NAME = "test_event_script_app"
COGNITO_TRIGGER_MAPPING = {}
16 changes: 8 additions & 8 deletions tests/test_exception_handler_settings.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
API_STAGE = 'dev'
APP_FUNCTION = 'raises_exception'
APP_MODULE = 'tests.test_handler'
API_STAGE = "dev"
APP_FUNCTION = "raises_exception"
APP_MODULE = "tests.test_handler"
BINARY_SUPPORT = False
CONTEXT_HEADER_MAPPINGS = {}
DEBUG = 'True'
DEBUG = "True"
DJANGO_SETTINGS = None
DOMAIN = 'api.example.com'
DOMAIN = "api.example.com"
ENVIRONMENT_VARIABLES = {}
LOG_LEVEL = 'DEBUG'
PROJECT_NAME = 'raises_exception'
LOG_LEVEL = "DEBUG"
PROJECT_NAME = "raises_exception"
COGNITO_TRIGGER_MAPPING = {}
EXCEPTION_HANDLER = 'tests.test_handler.mocked_exception_handler'
EXCEPTION_HANDLER = "tests.test_handler.mocked_exception_handler"
Loading

0 comments on commit 1a7f9f0

Please sign in to comment.