-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_spell_loading.py
More file actions
44 lines (39 loc) · 1.24 KB
/
test_spell_loading.py
File metadata and controls
44 lines (39 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python3
"""Test spell loading"""
print("Step 1: Importing...")
try:
from dnd_5e_core.data.collections import get_collections_directory
print(f" Collections dir: {get_collections_directory()}")
except Exception as e:
print(f" ERROR: {e}")
import traceback
traceback.print_exc()
print("\nStep 2: Getting spells list...")
try:
from dnd_5e_core.data.collections import get_spells_list
spells_list = get_spells_list()
print(f" Found {len(spells_list)} spell indexes")
print(f" First 3: {spells_list[:3]}")
except Exception as e:
print(f" ERROR: {e}")
import traceback
traceback.print_exc()
print("\nStep 3: Loading first spell...")
try:
from dnd_5e_core.data.loader import load_spell
first_spell = load_spell(spells_list[0])
print(f" Loaded: {first_spell.name if first_spell else 'None'}")
except Exception as e:
print(f" ERROR: {e}")
import traceback
traceback.print_exc()
print("\nStep 4: Loading all spells...")
try:
from dnd_5e_core.data.collections import load_all_spells
all_spells = load_all_spells()
print(f" Loaded {len(all_spells)} spells")
except Exception as e:
print(f" ERROR: {e}")
import traceback
traceback.print_exc()
print("\nDone!")