883 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
28 lines
1.8 KiB
Python
28 lines
1.8 KiB
Python
"""Multi-effect holder masks reuse the complete existing trigger review."""
|
|
import copy,sys,unittest
|
|
from pathlib import Path
|
|
ROOT=Path(__file__).resolve().parents[1];sys.path[:0]=[str(ROOT/'ops'),str(ROOT/'tests')]
|
|
import aura_definition_profile as m
|
|
import spell_defensive_buff_test as defensive
|
|
class DefensiveHolderTest(unittest.TestCase):
|
|
def fixture(self):
|
|
v=defensive.DefensiveBuffTest().fixture();c=defensive.DefensiveBuffTest().convert(v)
|
|
return c,v[2],dict(native=v[1],source_tables=v[5]['source_tables'],visual_links={})
|
|
def test_both_reviewed_effects_keep_one_server_holder(self):
|
|
c,s,k=self.fixture();r=m.generate_defensive_component(c,s,**k)
|
|
self.assertEqual([(x['spell'],x['effect_indices'],x['active_flags'])for x in r['definitions']],[(600142,[0,1],3)])
|
|
def test_partial_or_changed_effects_source_and_indices_reject(self):
|
|
for mode in ('amount','missing','source','indices','duplicate'):
|
|
c,s,k=self.fixture()
|
|
if mode=='amount':next(r for r in c['records']if r['table_name']=='SpellEffect')['record']['EffectBasePointsF']=50
|
|
elif mode=='missing':c['records']=[r for r in c['records']if not(r['table_name']=='SpellEffect'and r['record']['EffectIndex']==1)]
|
|
elif mode=='source':c['spells'][0]['source_definition']['effects'][0][2]=50
|
|
elif mode=='indices':c['spells'][0]['effect_indices']=[0]
|
|
else:c['spells'].append(copy.deepcopy(c['spells'][0]))
|
|
with self.assertRaises(ValueError,msg=mode):m.generate_defensive_component(c,s,**k)
|
|
def test_other_policy_or_claimed_runtime_acceptance_rejects(self):
|
|
for key,value in [('definition_policy','unchecked'),('installed',True),('engine_accepted',True),('gameplay_verified',True)]:
|
|
c,s,k=self.fixture();c[key]=value
|
|
with self.assertRaises(ValueError):m.generate_defensive_component(c,s,**k)
|
|
if __name__=='__main__':unittest.main()
|