Updated tests
This commit is contained in:
@@ -1,9 +1,15 @@
|
|||||||
import pytest
|
import pytest
|
||||||
import requests
|
from web import app
|
||||||
|
|
||||||
|
|
||||||
url = 'http://127.0.0.1:5000' # The root url of the flask app
|
@pytest.fixture
|
||||||
|
def client():
|
||||||
|
app.app.config['TESTING'] = True
|
||||||
|
client = app.app.test_client()
|
||||||
|
|
||||||
def test_index_page():
|
yield client
|
||||||
r = requests.get(url+'/') # Assumses that it has a path of "/"
|
|
||||||
assert r.status_code == 200 # Assumes that it will return a 200 response
|
def test_root_page(client):
|
||||||
|
|
||||||
|
rv = client.get('/')
|
||||||
|
assert b'Hello World!' in rv.data
|
||||||
|
|||||||
3
tests/pytest.ini
Normal file
3
tests/pytest.ini
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[pytest]
|
||||||
|
filterwarnings =
|
||||||
|
ignore::DeprecationWarning
|
||||||
Reference in New Issue
Block a user