Changed crystal template, picked latest flask one
This commit is contained in:
0
template/python3-flask/function/__init__.py
Normal file
0
template/python3-flask/function/__init__.py
Normal file
7
template/python3-flask/function/handler.py
Normal file
7
template/python3-flask/function/handler.py
Normal file
@ -0,0 +1,7 @@
|
||||
def handle(req):
|
||||
"""handle a request to the function
|
||||
Args:
|
||||
req (str): request body
|
||||
"""
|
||||
|
||||
return req
|
10
template/python3-flask/function/handler_test.py
Normal file
10
template/python3-flask/function/handler_test.py
Normal file
@ -0,0 +1,10 @@
|
||||
from .handler import handle
|
||||
|
||||
# Test your handler here
|
||||
|
||||
# To disable testing, you can set the build_arg `TEST_ENABLED=false` on the CLI or in your stack.yml
|
||||
# https://docs.openfaas.com/reference/yaml/#function-build-args-build-args
|
||||
|
||||
def test_handle():
|
||||
# assert handle("input") == "input"
|
||||
pass
|
0
template/python3-flask/function/requirements.txt
Normal file
0
template/python3-flask/function/requirements.txt
Normal file
41
template/python3-flask/function/tox.ini
Normal file
41
template/python3-flask/function/tox.ini
Normal file
@ -0,0 +1,41 @@
|
||||
# If you would like to disable
|
||||
# automated testing during faas-cli build,
|
||||
|
||||
# Replace the content of this file with
|
||||
# [tox]
|
||||
# skipsdist = true
|
||||
|
||||
# You can also edit, remove, or add additional test steps
|
||||
# by editing, removing, or adding new testenv sections
|
||||
|
||||
|
||||
# find out more about tox: https://tox.readthedocs.io/en/latest/
|
||||
[tox]
|
||||
envlist = lint,test
|
||||
skipsdist = true
|
||||
|
||||
[testenv:test]
|
||||
deps =
|
||||
flask
|
||||
pytest
|
||||
-rrequirements.txt
|
||||
commands =
|
||||
# run unit tests with pytest
|
||||
# https://docs.pytest.org/en/stable/
|
||||
# configure by adding a pytest.ini to your handler
|
||||
pytest
|
||||
|
||||
[testenv:lint]
|
||||
deps =
|
||||
flake8
|
||||
commands =
|
||||
flake8 .
|
||||
|
||||
[flake8]
|
||||
count = true
|
||||
max-line-length = 127
|
||||
max-complexity = 10
|
||||
statistics = true
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
select = E9,F63,F7,F82
|
||||
show-source = true
|
Reference in New Issue
Block a user