moving repository to gitea
This commit is contained in:
19
webapp/tests/test_app.py
Normal file
19
webapp/tests/test_app.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import pytest
|
||||
from app import app
|
||||
|
||||
|
||||
# set up a test client for the Flask app.
|
||||
# configure the app for testing and provides a client to make requests.
|
||||
@pytest.fixture
|
||||
def client():
|
||||
app.config['TESTING'] = True
|
||||
with app.test_client() as client:
|
||||
yield client
|
||||
|
||||
|
||||
# test checks that the home page ('/') loads successfully
|
||||
# and contains the word 'Welcome' in the response.
|
||||
def test_home_page(client):
|
||||
response = client.get('/') # Send GET request to home page
|
||||
assert response.status_code == 200 # Page should load successfully
|
||||
assert b"Welcome" in response.data # Page should contain 'Welcome'
|
||||
Reference in New Issue
Block a user