MCPcopy Create free account
hub / github.com/dds-bridge/dds / test_par_basic

Method test_par_basic

python/tests/test_par.py:13–33  ·  view source on GitHub ↗

Test basic par calculation with a simple DD table.

(self)

Source from the content-addressed store, hash-verified

11 """Tests for par (par score calculation)."""
12
13 def test_par_basic(self) -> None:
14 """Test basic par calculation with a simple DD table."""
15 # First, create a DD table result
16 table_deal = {
17 "cards": [
18 [0x7FFC, 0, 0, 0],
19 [0, 0x7FFC, 0, 0],
20 [0, 0, 0x7FFC, 0],
21 [0, 0, 0, 0x7FFC],
22 ],
23 }
24
25 # Note: We can't easily test par without a valid DD table
26 # This test demonstrates the API but may not produce meaningful results
27 try:
28 dd_table = calc_dd_table(table_deal)
29 result = par(dd_table)
30 self.assertTrue(isinstance(result, dict))
31 except RuntimeError:
32 # Invalid table is acceptable
33 raise SkipTest("Could not create valid DD table")
34
35 def test_par_vulnerable_none(self) -> None:
36 """Test par with vulnerable=0 (neither vulnerable)."""

Callers

nothing calls this directly

Calls 1

calc_dd_tableFunction · 0.85

Tested by

no test coverage detected