Skip to content

Commit faca2aa

Browse files
committed
Fix Streamlit UI tests to look in correct pygetpapers/ directory
- Update test_streamlit_ui.py to check for files in pygetpapers/ directory - Fix import paths to use pygetpapers.streamlit_app and pygetpapers.run_streamlit - Fix file existence checks to look in pygetpapers/ subdirectory - Fix syntax compilation tests to use correct file paths This ensures tests pass and GitHub Actions won't fail due to incorrect file paths.
1 parent d0d4717 commit faca2aa

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

tests/test_streamlit_ui.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,81 +11,81 @@
1111
def test_streamlit_app_import():
1212
"""Test that the streamlit app module can be imported"""
1313
try:
14-
# Test importing the main streamlit app from root directory
14+
# Test importing the main streamlit app from pygetpapers directory
1515
result = subprocess.run(
16-
[sys.executable, "-c", "import streamlit_app"],
16+
[sys.executable, "-c", "import pygetpapers.streamlit_app"],
1717
capture_output=True,
1818
text=True,
1919
timeout=30,
2020
cwd=".", # Run from current directory (root)
2121
)
2222
assert (
2323
result.returncode == 0
24-
), f"Failed to import streamlit_app: {result.stderr}"
24+
), f"Failed to import pygetpapers.streamlit_app: {result.stderr}"
2525
except Exception as e:
26-
assert False, f"Failed to import streamlit_app: {e}"
26+
assert False, f"Failed to import pygetpapers.streamlit_app: {e}"
2727

2828

2929
def test_run_streamlit_import():
3030
"""Test that the run_streamlit module can be imported"""
3131
try:
32-
# Test importing the run_streamlit module from root directory
32+
# Test importing the run_streamlit module from pygetpapers directory
3333
result = subprocess.run(
34-
[sys.executable, "-c", "import run_streamlit"],
34+
[sys.executable, "-c", "import pygetpapers.run_streamlit"],
3535
capture_output=True,
3636
text=True,
3737
timeout=30,
3838
cwd=".", # Run from current directory (root)
3939
)
4040
assert (
4141
result.returncode == 0
42-
), f"Failed to import run_streamlit: {result.stderr}"
42+
), f"Failed to import pygetpapers.run_streamlit: {result.stderr}"
4343
except Exception as e:
44-
assert False, f"Failed to import run_streamlit: {e}"
44+
assert False, f"Failed to import pygetpapers.run_streamlit: {e}"
4545

4646

4747
def test_streamlit_app_exists():
4848
"""Test that the streamlit app file exists"""
49-
app_path = Path("streamlit_app.py")
50-
assert app_path.exists(), "streamlit_app.py should exist"
49+
app_path = Path("pygetpapers/streamlit_app.py")
50+
assert app_path.exists(), "pygetpapers/streamlit_app.py should exist"
5151

5252

5353
def test_run_streamlit_exists():
5454
"""Test that the run_streamlit file exists"""
55-
run_path = Path("run_streamlit.py")
56-
assert run_path.exists(), "run_streamlit.py should exist"
55+
run_path = Path("pygetpapers/run_streamlit.py")
56+
assert run_path.exists(), "pygetpapers/run_streamlit.py should exist"
5757

5858

5959
def test_streamlit_app_syntax():
6060
"""Test that the streamlit app has valid Python syntax"""
6161
try:
6262
result = subprocess.run(
63-
[sys.executable, "-m", "py_compile", "streamlit_app.py"],
63+
[sys.executable, "-m", "py_compile", "pygetpapers/streamlit_app.py"],
6464
capture_output=True,
6565
text=True,
6666
timeout=30,
6767
)
6868
assert (
6969
result.returncode == 0
70-
), f"streamlit_app.py has syntax errors: {result.stderr}"
70+
), f"pygetpapers/streamlit_app.py has syntax errors: {result.stderr}"
7171
except Exception as e:
72-
assert False, f"Failed to compile streamlit_app.py: {e}"
72+
assert False, f"Failed to compile pygetpapers/streamlit_app.py: {e}"
7373

7474

7575
def test_run_streamlit_syntax():
7676
"""Test that the run_streamlit file has valid Python syntax"""
7777
try:
7878
result = subprocess.run(
79-
[sys.executable, "-m", "py_compile", "run_streamlit.py"],
79+
[sys.executable, "-m", "py_compile", "pygetpapers/run_streamlit.py"],
8080
capture_output=True,
8181
text=True,
8282
timeout=30,
8383
)
8484
assert (
8585
result.returncode == 0
86-
), f"run_streamlit.py has syntax errors: {result.stderr}"
86+
), f"pygetpapers/run_streamlit.py has syntax errors: {result.stderr}"
8787
except Exception as e:
88-
assert False, f"Failed to compile run_streamlit.py: {e}"
88+
assert False, f"Failed to compile pygetpapers/run_streamlit.py: {e}"
8989

9090

9191
if __name__ == "__main__":

0 commit comments

Comments
 (0)