883 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
42 lines
1.6 KiB
Python
42 lines
1.6 KiB
Python
"""Bulk aura visual matching keeps ambiguous links held and joins native rows once."""
|
|
from pathlib import Path
|
|
import sys
|
|
import unittest
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
sys.path.insert(0, str(ROOT / 'ops'))
|
|
import aura_visual_profile as visual
|
|
|
|
|
|
class NativeRow(dict):
|
|
reads = 0
|
|
|
|
def get(self, key, default=None):
|
|
if key == 'SpellID':
|
|
type(self).reads += 1
|
|
return super().get(key, default)
|
|
|
|
|
|
class AuraVisualBulkTest(unittest.TestCase):
|
|
def test_shared_native_index_preserves_ambiguity_and_conditional_holds(self):
|
|
source = [{'entry': i, 'spellVisual1': 5000 + i, 'spellVisual2': 0}
|
|
for i in range(1, 201)]
|
|
native = [NativeRow(ID=9000 + i, SpellID=i, SpellVisualID=5000 + i,
|
|
DifficultyID=0, Flags2=0, Probability=1,
|
|
**{field: 0 for field in visual.CONDITIONS})
|
|
for i in range(1, 201)]
|
|
native[1]['CasterPlayerConditionID'] = 7
|
|
native.append(NativeRow(native[2], ID=10003))
|
|
NativeRow.reads = 0
|
|
result = visual.generate(source, native)
|
|
self.assertEqual(NativeRow.reads, len(native))
|
|
self.assertEqual(len(result['definitions']), 198)
|
|
self.assertEqual({row['spell'] for row in result['excluded']}, {2, 3})
|
|
self.assertEqual(result['definitions'][0],
|
|
{'spell': 1, 'spell_x_spell_visual': 9001, 'visual': 5001})
|
|
self.assertTrue(any('renderer behavior' in limit for limit in result['limits']))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|