Updated tests

This commit is contained in:
2019-07-04 19:35:11 +01:00
parent 2f254c74c2
commit bed7b9e258
3 changed files with 14 additions and 5 deletions

View File

@@ -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
View File

@@ -0,0 +1,3 @@
[pytest]
filterwarnings =
ignore::DeprecationWarning

View File