feat: add StemAtlas Streamlit app, explorer, Docker deployment, blog charts
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
"""Smoke test: explorer module is importable without DB or heavy computation."""
|
||||
|
||||
import importlib
|
||||
|
||||
|
||||
def test_explorer_importable():
|
||||
mod = importlib.import_module("explorer")
|
||||
assert hasattr(mod, "run_app")
|
||||
assert callable(mod.run_app)
|
||||
assert hasattr(mod, "load_positions")
|
||||
assert hasattr(mod, "load_motions_df")
|
||||
assert hasattr(mod, "query_similar")
|
||||
assert hasattr(mod, "build_compass_tab")
|
||||
assert hasattr(mod, "build_search_tab")
|
||||
@@ -0,0 +1,38 @@
|
||||
"""Smoke test: Home module is importable without DB or heavy computation."""
|
||||
|
||||
import importlib
|
||||
import sys
|
||||
|
||||
|
||||
def test_home_importable():
|
||||
# Streamlit cannot run set_page_config outside of a server context,
|
||||
# so we only verify the file can be parsed/compiled, not fully executed.
|
||||
import ast
|
||||
import os
|
||||
|
||||
home_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "Home.py")
|
||||
with open(home_path) as f:
|
||||
source = f.read()
|
||||
|
||||
# Verify the file parses as valid Python
|
||||
tree = ast.parse(source)
|
||||
|
||||
# Verify st.set_page_config is called at module level (first Streamlit command)
|
||||
calls = [
|
||||
node
|
||||
for node in ast.walk(tree)
|
||||
if isinstance(node, ast.Call)
|
||||
and isinstance(node.func, ast.Attribute)
|
||||
and node.func.attr == "set_page_config"
|
||||
]
|
||||
assert calls, "Home.py must call st.set_page_config()"
|
||||
|
||||
# Verify page links exist (st.page_link calls)
|
||||
page_links = [
|
||||
node
|
||||
for node in ast.walk(tree)
|
||||
if isinstance(node, ast.Call)
|
||||
and isinstance(node.func, ast.Attribute)
|
||||
and node.func.attr == "page_link"
|
||||
]
|
||||
assert len(page_links) >= 2, "Home.py must have at least 2 st.page_link() calls"
|
||||
Reference in New Issue
Block a user