def apply_attribute_table(character): if 'Attribute_Bonuses' not in character: character['Attribute_Bonuses'] = FlockDict() for (attribute, bonus), table in get_attribute_table().items(): character['Attribute_Bonuses'][bonus] = lookup(character, attribute, table) character['base_bonuses'] = {'Spell Points Multiple': {'General': 1}} character['bonuses'] = FlockAggregator([character['Attribute_Bonuses'], character['base_bonuses']], cross_total)
def apply_attribute_table(character): if 'Attribute_Bonuses' not in character: character['Attribute_Bonuses'] = FlockDict() for (attribute, bonus), table in get_attribute_table().items(): character['Attribute_Bonuses'][bonus] = lookup(character, attribute, table) character['base_bonuses'] = {'Spell Points Multiple': {'General': 1}} character['bonuses'] = FlockAggregator( [character['Attribute_Bonuses'], character['base_bonuses']], cross_total)
def test_lookup(self): probe = uuid.uuid4() table_row = 5 base_dict = {'x': table_row} table = {table_row: probe} assert probe is lookup(base_dict, 'x', table)()