Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a 3.10.4 vanilla save to test cases #129

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions test/parser_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import pathlib
from rust_parser import rust_parser

import parser_test_cases
Expand All @@ -24,14 +25,21 @@ def test_deep_recursion_depth():
)
rust_parser.parse_save_from_string(test_input)


def test_real_save():
@pytest.mark.parametrize(
"save_dir",
[path for path in pathlib.Path(__file__).parent.glob(r"saves/*")],
ids=lambda path: path.stem,
)
def test_real_save(save_dir, tmp_path):
# Test a real save end to end
from stellarisdashboard import cli, config
from pathlib import Path
debug = config.CONFIG.debug_mode
base_path = config.CONFIG.base_output_path

config.CONFIG.debug_mode = True
output_db = Path(
f"{config.CONFIG.base_output_path}/db/nexitronawareness_1329922464.db"
)
cli.f_parse_saves(save_path="test/saves")
output_db.unlink(missing_ok=True)
config.CONFIG.base_output_path = tmp_path
try:
cli.f_parse_saves(save_path=save_dir)
finally:
config.CONFIG.debug_mode = debug
config.CONFIG.base_output_path = base_path
Binary file not shown.
Loading