This commit is contained in:
parent
6ab583af33
commit
d015451e55
3 changed files with 11 additions and 3 deletions
4
app.py
4
app.py
|
@ -1,9 +1,11 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Creatr App"""
|
||||
from flask import Flask
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route('/')
|
||||
def hello():
|
||||
def index():
|
||||
"""Show index page"""
|
||||
return "Hello Fediverse!"
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Build test fixture"""
|
||||
|
||||
import pytest
|
||||
from app import app as flask_app
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def app():
|
||||
@pytest.fixture(name="app")
|
||||
def fixture_app():
|
||||
"""Build flask app"""
|
||||
yield flask_app
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client(app):
|
||||
"""Build test client"""
|
||||
return app.test_client()
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Test App index"""
|
||||
|
||||
def test_request_example(client):
|
||||
"""Test index path"""
|
||||
response = client.get("/")
|
||||
assert b"Hello Fediverse!" in response.data
|
||||
|
|
Loading…
Reference in a new issue