|
11 | 11 | def test_streamlit_app_import(): |
12 | 12 | """Test that the streamlit app module can be imported""" |
13 | 13 | try: |
14 | | - # Test importing the main streamlit app from root directory |
| 14 | + # Test importing the main streamlit app from pygetpapers directory |
15 | 15 | result = subprocess.run( |
16 | | - [sys.executable, "-c", "import streamlit_app"], |
| 16 | + [sys.executable, "-c", "import pygetpapers.streamlit_app"], |
17 | 17 | capture_output=True, |
18 | 18 | text=True, |
19 | 19 | timeout=30, |
20 | 20 | cwd=".", # Run from current directory (root) |
21 | 21 | ) |
22 | 22 | assert ( |
23 | 23 | result.returncode == 0 |
24 | | - ), f"Failed to import streamlit_app: {result.stderr}" |
| 24 | + ), f"Failed to import pygetpapers.streamlit_app: {result.stderr}" |
25 | 25 | 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}" |
27 | 27 |
|
28 | 28 |
|
29 | 29 | def test_run_streamlit_import(): |
30 | 30 | """Test that the run_streamlit module can be imported""" |
31 | 31 | try: |
32 | | - # Test importing the run_streamlit module from root directory |
| 32 | + # Test importing the run_streamlit module from pygetpapers directory |
33 | 33 | result = subprocess.run( |
34 | | - [sys.executable, "-c", "import run_streamlit"], |
| 34 | + [sys.executable, "-c", "import pygetpapers.run_streamlit"], |
35 | 35 | capture_output=True, |
36 | 36 | text=True, |
37 | 37 | timeout=30, |
38 | 38 | cwd=".", # Run from current directory (root) |
39 | 39 | ) |
40 | 40 | assert ( |
41 | 41 | result.returncode == 0 |
42 | | - ), f"Failed to import run_streamlit: {result.stderr}" |
| 42 | + ), f"Failed to import pygetpapers.run_streamlit: {result.stderr}" |
43 | 43 | 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}" |
45 | 45 |
|
46 | 46 |
|
47 | 47 | def test_streamlit_app_exists(): |
48 | 48 | """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" |
51 | 51 |
|
52 | 52 |
|
53 | 53 | def test_run_streamlit_exists(): |
54 | 54 | """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" |
57 | 57 |
|
58 | 58 |
|
59 | 59 | def test_streamlit_app_syntax(): |
60 | 60 | """Test that the streamlit app has valid Python syntax""" |
61 | 61 | try: |
62 | 62 | result = subprocess.run( |
63 | | - [sys.executable, "-m", "py_compile", "streamlit_app.py"], |
| 63 | + [sys.executable, "-m", "py_compile", "pygetpapers/streamlit_app.py"], |
64 | 64 | capture_output=True, |
65 | 65 | text=True, |
66 | 66 | timeout=30, |
67 | 67 | ) |
68 | 68 | assert ( |
69 | 69 | result.returncode == 0 |
70 | | - ), f"streamlit_app.py has syntax errors: {result.stderr}" |
| 70 | + ), f"pygetpapers/streamlit_app.py has syntax errors: {result.stderr}" |
71 | 71 | 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}" |
73 | 73 |
|
74 | 74 |
|
75 | 75 | def test_run_streamlit_syntax(): |
76 | 76 | """Test that the run_streamlit file has valid Python syntax""" |
77 | 77 | try: |
78 | 78 | result = subprocess.run( |
79 | | - [sys.executable, "-m", "py_compile", "run_streamlit.py"], |
| 79 | + [sys.executable, "-m", "py_compile", "pygetpapers/run_streamlit.py"], |
80 | 80 | capture_output=True, |
81 | 81 | text=True, |
82 | 82 | timeout=30, |
83 | 83 | ) |
84 | 84 | assert ( |
85 | 85 | result.returncode == 0 |
86 | | - ), f"run_streamlit.py has syntax errors: {result.stderr}" |
| 86 | + ), f"pygetpapers/run_streamlit.py has syntax errors: {result.stderr}" |
87 | 87 | 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}" |
89 | 89 |
|
90 | 90 |
|
91 | 91 | if __name__ == "__main__": |
|
0 commit comments