pyfly-demo/tests/test_simple.py
2019-05-23 10:28:51 +01:00

27 lines
611 B
Python

import json
from app import simple
class TestSimple:
def setup(self):
self.app = simple.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