fix player win % and visual overhaul
This commit is contained in:
16 files changed
+3123
-1490
No files matched your search
@@ -5,6 +5,42 @@ from boker.services import build_leaderboard
|
||||
|
||||
|
||||
class CashInAccountingTest(unittest.TestCase):
|
||||
def test_leaderboard_win_pct_is_percent_not_ratio(self):
|
||||
sessions = [
|
||||
SessionSummary(
|
||||
session_id="2026-06-21-01",
|
||||
session_date="2026-06-21",
|
||||
entries=[
|
||||
SessionEntry(
|
||||
session_id="2026-06-21-01",
|
||||
session_date="2026-06-21",
|
||||
player_name="Alex",
|
||||
buy_in_cents=1000,
|
||||
cash_out_cents=1500,
|
||||
)
|
||||
],
|
||||
),
|
||||
SessionSummary(
|
||||
session_id="2026-06-28-01",
|
||||
session_date="2026-06-28",
|
||||
entries=[
|
||||
SessionEntry(
|
||||
session_id="2026-06-28-01",
|
||||
session_date="2026-06-28",
|
||||
player_name="Alex",
|
||||
buy_in_cents=1000,
|
||||
cash_out_cents=0,
|
||||
)
|
||||
],
|
||||
),
|
||||
]
|
||||
|
||||
player = build_leaderboard(sessions)[0]
|
||||
|
||||
self.assertEqual(player.winning_sessions, 1)
|
||||
self.assertEqual(player.sessions_played, 2)
|
||||
self.assertEqual(player.win_pct, 50.0)
|
||||
|
||||
def test_front_is_poker_investment_not_cash_in(self):
|
||||
entry = SessionEntry(
|
||||
session_id="2026-06-21-01",
|
||||
|
||||
Reference in new issue
Block a user