Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Robyn and SubRouter classes #1072

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: add basic unit tests to be sure we can create Robyn and SubRout…
…er with empty lists of routes. This will confirm the imports haven't changed from the docs
  • Loading branch information
dave42w committed Dec 6, 2024
commit 7dd2bc9498a5e67bfe6c2922f074c04365306b1b
16 changes: 16 additions & 0 deletions unit_tests/test_robyn_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from robyn.router import Router
from robyn import Robyn, SubRouter


def test_app_creation():
app = Robyn(__file__)
router = app.router
assert isinstance(router, Router)
assert len(router.routes) == 0


def test_subrouter_creation():
sub = SubRouter(__name__, prefix="/frontend")
router = sub.router
assert isinstance(router, Router)
assert len(router.routes) == 0
Loading