Skip to content

Commit

Permalink
Change tests to use save files not in the main repo (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
chennin authored May 13, 2024
1 parent 9b4e4d2 commit b07c607
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- macOS-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -50,7 +52,7 @@ jobs:
pip install --find-links=stellarisdashboard/parsing/rust_parser/target rust-parser
- name: Tests
run: |
python -m pytest -m "not skip_github_actions"
python -m pytest -m "not skip_github_actions" --verbose
- name: pyInstaller build
run: |
pyinstaller pyinstaller-package.spec
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "test/saves"]
path = test/saves
url = https://github.com/chennin/stellaris-dashboard-test-saves
8 changes: 3 additions & 5 deletions test/parser_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ def test_deep_recursion_depth():
rust_parser.parse_save_from_string(test_input)


def test_real_save():
def test_real_save(tmp_path):
# Test a real save end to end
from stellarisdashboard import cli, config
from pathlib import Path
config.CONFIG.debug_mode = True
output_db = Path(
f"{config.CONFIG.base_output_path}/db/nexitronawareness_1329922464.db"
)
config.CONFIG.base_output_path = tmp_path
cli.f_parse_saves(save_path="test/saves")
output_db.unlink(missing_ok=True)
assert len(list(tmp_path.glob('**/*.db'))) > 0, f"When parsing saves, no output .db files were produced (output folder: {tmp_path})"
1 change: 1 addition & 0 deletions test/saves
Submodule saves added at 8fdcb6
Binary file not shown.

0 comments on commit b07c607

Please sign in to comment.