Browse Source

remove test_routes

Falko Schindler 2 năm trước cách đây
mục cha
commit
c6c72fb069
2 tập tin đã thay đổi với 9 bổ sung31 xóa
  1. 9 0
      tests/test_pages.py
  2. 0 31
      tests/test_routes.py

+ 9 - 0
tests/test_pages.py

@@ -268,3 +268,12 @@ def test_exception_in_on_page_ready_callback(screen: Screen):
     screen.open('/')
     screen.should_contain('this is shown')
     screen.assert_py_logger('ERROR', 'Failed to execute page-ready')
+
+
+def test_page_with_args(screen: Screen):
+    @ui.page('/page/{id}')
+    def page(id: int):
+        ui.label(f'Page {id}')
+
+    screen.open('/page/42')
+    screen.should_contain('Page 42')

+ 0 - 31
tests/test_routes.py

@@ -1,31 +0,0 @@
-from nicegui import ui
-from starlette import responses
-
-from .screen import Screen
-
-
-def test_get(screen: Screen):
-    @ui.get('/some/route')
-    def some_route():
-        return responses.PlainTextResponse('Ok')
-
-    screen.open('/some/route')
-    screen.should_contain('Ok')
-
-
-def test_get_with_args(screen: Screen):
-    @ui.get('/route/{id}')
-    def route(id: int):
-        return responses.PlainTextResponse(f'id={id}')
-
-    screen.open('/route/42')
-    screen.should_contain('id=42')
-
-
-def test_page_with_args(screen: Screen):
-    @ui.page('/page/{id}')
-    def page(id: int):
-        ui.label(f'Page {id}')
-
-    screen.open('/page/42')
-    screen.should_contain('Page 42')