[lint] fix lint
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
SouthFox 2023-06-08 16:54:36 +08:00
parent 6ab583af33
commit d015451e55
3 changed files with 11 additions and 3 deletions

4
app.py
View file

@ -1,9 +1,11 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
"""Creatr App"""
from flask import Flask from flask import Flask
app = Flask(__name__) app = Flask(__name__)
@app.route('/') @app.route('/')
def hello(): def index():
"""Show index page"""
return "Hello Fediverse!" return "Hello Fediverse!"

View file

@ -1,13 +1,17 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
"""Build test fixture"""
import pytest import pytest
from app import app as flask_app from app import app as flask_app
@pytest.fixture @pytest.fixture(name="app")
def app(): def fixture_app():
"""Build flask app"""
yield flask_app yield flask_app
@pytest.fixture @pytest.fixture
def client(app): def client(app):
"""Build test client"""
return app.test_client() return app.test_client()

View file

@ -1,5 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
"""Test App index"""
def test_request_example(client): def test_request_example(client):
"""Test index path"""
response = client.get("/") response = client.get("/")
assert b"Hello Fediverse!" in response.data assert b"Hello Fediverse!" in response.data