def proficiencies(self): """Aggregate proficiencies that the PC has learned.""" p = { base.WEAPON_PROFICIENCY: [], base.ARMOR_PROFICIENCY: [], base.TOOL_PROFICIENCY: [], } for prof_group in [ self.race.proficiencies, self.vocation.proficiencies, self.background.proficiencies ]: for prof in prof_group.keys(): if prof not in p: p[prof] = [] p[prof] = p[prof] + prof_group[prof].proficiencies # Weapon proficiencies are a bit strange because there are weapon categories # and specific weapon proficiencies. p[base. WEAPON_PROFICIENCY] = weapons.get_aggregated_weapon_proficiencies( p[base.WEAPON_PROFICIENCY]) return p
def test_get_aggregated_weapon_proficiencies(self): proficiencies = ['mace', 'rapier'] result = weapons.get_aggregated_weapon_proficiencies(proficiencies) expected = ['mace', 'rapier'] self.assertEqual(expected, result)