import os import time import pytest from app import app def createFile(name, size): # create a file of random data with open(name, 'wb') as fout: fout.write(os.urandom(size)) # replace 1024 with size_kb if not unreasonably large @pytest.fixture def client(): app.config['TESTING'] = True with app.test_client() as client: yield client def test_homepage(client): """Test that the homepage can be generated""" rv = client.get('/') # assert all the controls are there assert b'