mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-12-16 23:50:12 +01:00
feat: complete include/exclude observability, fix validation bugs, and organize tests
- Add structured logging for include/exclude operations with comprehensive event tracking - Fix duplicate counting bug in validation API by eliminating double validation passes - Simplify color identity validation UX by consolidating into single 'illegal' status - Organize project structure by moving all test files to centralized code/tests/ directory - Update documentation reflecting feature completion and production readiness - Add validation test scripts and performance benchmarks confirming targets met - Finalize include/exclude feature as production-ready with EDH format compliance
This commit is contained in:
parent
f77bce14cb
commit
3e4395d6e9
32 changed files with 470 additions and 89 deletions
36
code/tests/test_lightning_direct.py
Normal file
36
code/tests/test_lightning_direct.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Test Lightning Bolt directly"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'code'))
|
||||
|
||||
from deck_builder.include_exclude_utils import fuzzy_match_card_name
|
||||
import pandas as pd
|
||||
|
||||
cards_df = pd.read_csv('csv_files/cards.csv', low_memory=False)
|
||||
available_cards = set(cards_df['name'].dropna().unique())
|
||||
|
||||
# Test if Lightning Bolt gets the right score
|
||||
result = fuzzy_match_card_name('bolt', available_cards)
|
||||
print(f"'bolt' matches: {result.suggestions[:5]}")
|
||||
|
||||
result = fuzzy_match_card_name('lightn', available_cards)
|
||||
print(f"'lightn' matches: {result.suggestions[:5]}")
|
||||
|
||||
# Check if Lightning Bolt is in the suggestions
|
||||
if 'Lightning Bolt' in result.suggestions:
|
||||
print(f"Lightning Bolt is suggestion #{result.suggestions.index('Lightning Bolt') + 1}")
|
||||
else:
|
||||
print("Lightning Bolt NOT in suggestions!")
|
||||
|
||||
# Test a few more obvious ones
|
||||
result = fuzzy_match_card_name('lightning', available_cards)
|
||||
print(f"'lightning' matches: {result.suggestions[:3]}")
|
||||
|
||||
result = fuzzy_match_card_name('warp', available_cards)
|
||||
print(f"'warp' matches: {result.suggestions[:3]}")
|
||||
|
||||
# Also test the exact card name to make sure it's working
|
||||
result = fuzzy_match_card_name('Lightning Bolt', available_cards)
|
||||
print(f"'Lightning Bolt' exact: {result.matched_name} (confidence: {result.confidence:.3f})")
|
||||
Loading…
Add table
Add a link
Reference in a new issue