瀏覽代碼

Start shimming out route tests

Getty Ritter 5 年之前
父節點
當前提交
e5315366a8
共有 1 個文件被更改,包括 20 次插入0 次删除
  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"