Browse Source

Start shimming out route tests

Getty Ritter 4 years ago
parent
commit
e5315366a8
1 changed files with 20 additions and 0 deletions
  1. 20 0
      tests/routes.py

+ 20 - 0
tests/routes.py

@@ -0,0 +1,20 @@
+import lc.config as c
+import lc.model as m
+import lc.routes as r
+
+
+class TestRoutes:
+    def setup_method(self, _):
+        c.DB.init(":memory:")
+        c.DB.create_tables(m.MODELS)
+        self.app = r.app.test_client()
+
+    def teardown_method(self, _):
+        c.DB.close()
+
+    def get(self, path):
+        return self.app.get(path)
+
+    def test_index(self):
+        result = self.get("/")
+        assert result.status == "200 OK"