This repository was archived by the owner on Sep 29, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +1
-23
lines changed
pems_streamlit/src/pems_streamlit
tests/pytest/pems_streamlit Expand file tree Collapse file tree 3 files changed +1
-23
lines changed Original file line number Diff line number Diff line change 1
- import streamlit as st
2
-
3
- st .write ("https://pems.dot.ca.gov" )
Original file line number Diff line number Diff line change @@ -14,10 +14,6 @@ def _convert_to_pages(apps: list[Path]) -> list[StreamlitPage]:
14
14
return list (map (_make_app_page , apps ))
15
15
16
16
17
- def _default_app_page () -> StreamlitPage :
18
- return st .Page (APP_DIR / "__init__.py" , default = True , title = "PeMS Streamlit apps" )
19
-
20
-
21
17
def _discover_apps () -> list [Path ]:
22
18
logger .info ("Beginning streamlit app discovery" )
23
19
@@ -51,8 +47,6 @@ def _make_app_page(app_path: Path) -> StreamlitPage:
51
47
52
48
53
49
def discover_apps () -> list [StreamlitPage ]:
54
- default_app_page = _default_app_page ()
55
50
apps = _discover_apps ()
56
51
pages = _convert_to_pages (apps )
57
- pages .insert (0 , default_app_page )
58
52
return pages
Original file line number Diff line number Diff line change 1
1
from pathlib import Path
2
2
3
3
import pytest
4
- from streamlit .navigation .page import StreamlitPage
5
4
6
5
from pems_streamlit import utils
7
6
@@ -34,13 +33,6 @@ def test_convert_to_pages(mocker, app_paths):
34
33
assert mocker .call (path ) in page_factory .mock_calls
35
34
36
35
37
- def test_default_app_page ():
38
- page = utils ._default_app_page ()
39
-
40
- assert page ._default
41
- assert page .url_path == ""
42
-
43
-
44
36
def test__discover_apps (app_paths ):
45
37
discovered = utils ._discover_apps ()
46
38
@@ -70,12 +62,7 @@ def test_discover_apps(mocker):
70
62
mock_discover = mocker .patch ("pems_streamlit.utils._discover_apps" , return_value = [])
71
63
mock_convert = mocker .patch ("pems_streamlit.utils._convert_to_pages" , return_value = [])
72
64
73
- result = utils .discover_apps ()
65
+ utils .discover_apps ()
74
66
75
67
mock_discover .assert_called_once ()
76
68
mock_convert .assert_called_once ()
77
-
78
- assert len (result ) == 1
79
- page = result [0 ]
80
- assert isinstance (page , StreamlitPage )
81
- assert page ._default
You can’t perform that action at this time.
0 commit comments