Skip to content
This repository was archived by the owner on Apr 28, 2026. It is now read-only.

Commit fa754ad

Browse files
committed
update test
1 parent 608fda4 commit fa754ad

2 files changed

Lines changed: 32 additions & 32 deletions

File tree

tests/test_routes.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""Integration tests for all routes in Reflex."""
2+
3+
import sys
4+
from collections import Counter
5+
from pathlib import Path
6+
7+
import pytest
8+
9+
sys.path.append(str(Path(__file__).resolve().parent.parent))
10+
11+
12+
@pytest.fixture
13+
def routes_fixture():
14+
from pcweb.pages import routes
15+
16+
yield routes
17+
18+
19+
def test_unique_routes(routes_fixture):
20+
assert routes_fixture is not None
21+
22+
paths = [route.path for route in routes_fixture if route.path]
23+
24+
# Count occurrences of each path
25+
path_counts = Counter(paths)
26+
# Find duplicate paths
27+
duplicates = {path: count for path, count in path_counts.items() if count > 1}
28+
29+
# Assert that there are no duplicates
30+
assert len(duplicates) == 0, f"Duplicate routes found: {duplicates}"
31+
32+
print(f"Test passed. All {len(paths)} routes are unique.")

tests/test_titles.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)