diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-04-20 15:34:12 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-04-20 15:34:12 -0700 |
commit | 481bc70a364c38f112a58e69d1f5e1088ab23dcc (patch) | |
tree | 0a33b25f2e23fb50627574f4f9cb02d2c4a27264 /tests/frontend.py | |
parent | fd1bc46a147c491229a307245367ac451eb1f442 (diff) | |
download | fatcat-481bc70a364c38f112a58e69d1f5e1088ab23dcc.tar.gz fatcat-481bc70a364c38f112a58e69d1f5e1088ab23dcc.zip |
refactor tests
Diffstat (limited to 'tests/frontend.py')
-rw-r--r-- | tests/frontend.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/frontend.py b/tests/frontend.py new file mode 100644 index 00000000..e177f8c0 --- /dev/null +++ b/tests/frontend.py @@ -0,0 +1,32 @@ + +import os +import json +import pytest +import fatcat +import fatcat.sql +from fatcat.models import * +import unittest +import tempfile + + +@pytest.fixture +def app(): + fatcat.app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://' + fatcat.app.testing = True + fatcat.app.debug = True + fatcat.db.session.remove() + fatcat.db.drop_all() + fatcat.db.create_all() + fatcat.sql.populate_db() + return fatcat.app.test_client() + + +def test_static_routes(app): + + for route in ('/health', '/robots.txt', '/', '/about'): + rv = app.get(route) + assert rv.status_code == 200 + + assert app.get("/static/bogus/route").status_code == 404 + + |