mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2026-04-05 20:57:16 +02:00
test-cleanup: fix 21 failures, prune stale tests, consolidate fragmented files (#66)
Some checks are pending
CI / build (push) Waiting to run
Some checks are pending
CI / build (push) Waiting to run
* test-cleanup: fix 21 failures, prune stale tests, consolidate fragmented files * test-cleanup: remove permanently-skipped M4/perf tests, fix pydantic ConfigDict warning * docs: update changelog and release notes for test-cleanup changes * ci: fix editorial governance workflow stale test file reference
This commit is contained in:
parent
32157179f9
commit
46637cf27f
34 changed files with 5329 additions and 2202 deletions
|
|
@ -35,3 +35,27 @@ def test_generate_seed_range():
|
|||
assert s >= 0
|
||||
# Ensure it's within 63-bit range
|
||||
assert s < (1 << 63)
|
||||
|
||||
|
||||
def test_weighted_sample_deterministic_same_seed():
|
||||
from deck_builder import builder_utils as bu
|
||||
pool = [("a", 1), ("b", 2), ("c", 3), ("d", 4)]
|
||||
k = 3
|
||||
rng1 = set_seed(12345)
|
||||
sel1 = bu.weighted_sample_without_replacement(pool, k, rng=rng1)
|
||||
rng2 = set_seed(12345)
|
||||
sel2 = bu.weighted_sample_without_replacement(pool, k, rng=rng2)
|
||||
assert sel1 == sel2
|
||||
|
||||
|
||||
def test_compute_adjusted_target_deterministic_same_seed():
|
||||
from deck_builder import builder_utils as bu
|
||||
msgs: list[str] = []
|
||||
out = msgs.append
|
||||
original_cfg = 10
|
||||
existing = 4
|
||||
rng1 = set_seed(999)
|
||||
to_add1, bonus1 = bu.compute_adjusted_target("Ramp", original_cfg, existing, out, plural_word="ramp spells", rng=rng1)
|
||||
rng2 = set_seed(999)
|
||||
to_add2, bonus2 = bu.compute_adjusted_target("Ramp", original_cfg, existing, out, plural_word="ramp spells", rng=rng2)
|
||||
assert (to_add1, bonus1) == (to_add2, bonus2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue