add project structure
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
from pathlib import Path
|
||||
|
||||
import app.db as db
|
||||
|
||||
|
||||
def test_app_starts(client):
|
||||
response = client.get("/boxes")
|
||||
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_root_redirects_to_boxes(client):
|
||||
response = client.get("/", follow_redirects=False)
|
||||
|
||||
assert response.status_code == 302
|
||||
assert response.headers["location"] == "/boxes"
|
||||
|
||||
|
||||
def test_boxes_page_returns_200(client):
|
||||
response = client.get("/boxes")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Boxes page" in response.text
|
||||
|
||||
|
||||
def test_tests_use_isolated_sqlite_database(client):
|
||||
assert db.engine is not None
|
||||
|
||||
database_name = Path(db.engine.url.database)
|
||||
assert database_name.name == "test.db"
|
||||
assert "data/app.db" not in str(database_name)
|
||||
Reference in New Issue
Block a user