mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-12-17 08:00:13 +01:00
fix: prevent headless owned prompt loop
This commit is contained in:
parent
0e2eb29258
commit
ed285a47ab
5 changed files with 67 additions and 480 deletions
|
|
@ -15,4 +15,27 @@ def test_headless_seed_threads_into_builder(monkeypatch):
|
|||
assert getattr(out1, "seed", None) == getattr(out2, "seed", None) == 999
|
||||
# Basic sanity: commander selection should have occurred
|
||||
assert isinstance(getattr(out1, "commander_name", ""), str)
|
||||
assert isinstance(getattr(out2, "commander_name", ""), str)
|
||||
assert isinstance(getattr(out2, "commander_name", ""), str)
|
||||
|
||||
|
||||
def test_headless_skips_owned_prompt_when_files_present(monkeypatch, tmp_path):
|
||||
monkeypatch.setenv("CSV_FILES_DIR", os.path.join("csv_files", "testdata"))
|
||||
owned_dir = tmp_path / "owned"
|
||||
owned_dir.mkdir()
|
||||
(owned_dir / "my_cards.txt").write_text("1 Sol Ring\n", encoding="utf-8")
|
||||
monkeypatch.setenv("OWNED_CARDS_DIR", str(owned_dir))
|
||||
|
||||
builder = run(
|
||||
command_name="Krenko",
|
||||
add_lands=False,
|
||||
add_creatures=False,
|
||||
add_non_creature_spells=False,
|
||||
add_ramp=False,
|
||||
add_removal=False,
|
||||
add_wipes=False,
|
||||
add_card_advantage=False,
|
||||
add_protection=False,
|
||||
)
|
||||
|
||||
assert getattr(builder, "bracket_level", None) in {None, 3}
|
||||
assert getattr(builder, "use_owned_only", False) is False
|
||||
Loading…
Add table
Add a link
Reference in a new issue