-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_app.py
More file actions
23 lines (18 loc) · 831 Bytes
/
test_app.py
File metadata and controls
23 lines (18 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import pytest
import SpeedTrig
@pytest.fixture
def app():
SpeedTrig.app.config['TESTING'] = True
return SpeedTrig.app
def test_norm_reci(client):
response = client.post('generated-quiz', data=dict(title="Speed Trig Quiz", norm=True, reci=False, inc=False, Override=False, chance=40, num=2))
assert response.status_code == 200
def test_out_range(client):
response = client.post('generated-quiz', data=dict(title="Speed Trig Quiz #3", norm=True, reci=True, inc=True, Override=False, chance=40, num=2))
assert response.status_code == 200
def test_blank(client):
response = client.post('generated-quiz', data={})
assert response.status_code == 204
def test_outrange_blank(client):
response = client.post('generated-quiz', data=dict(norm=True, reci=True))
assert response.status_code == 200