pyfly-demo/tests/test_simple.py
2019-05-23 13:19:43 +01:00

26 lines
607 B
Python

import json
from app.simple import app
class TestSimple:
def setup(self):
self.app = app.test_client()
def teardown(self):
pass
def test_version(self):
resp = self.app.get('/version')
rjson = json.loads(resp.data)
assert rjson['version'] == 0.1
def test_random_numbers(self):
resp = self.app.get('/randoms')
rjson = json.loads(resp.data)
assert rjson['number'] <= 80
def test_random_string(self):
resp = self.app.get('/randoms')
rjson = json.loads(resp.data)
assert len(rjson['string']) <= 80