MCPcopy
hub / github.com/apache/caldera / verify

Method verify

app/objects/c_adversary.py:87–99  ·  view source on GitHub ↗
(self, log, abilities, objectives)

Source from the content-addressed store, hash-verified

85 return existing
86
87 def verify(self, log, abilities, objectives):
88 for ability_id in self.atomic_ordering:
89 if not next((ability for ability in abilities if ability.ability_id == ability_id), None):
90 log.warning('Ability referenced in adversary %s but not found: %s', self.adversary_id, ability_id)
91
92 if not self.objective:
93 self.objective = DEFAULT_OBJECTIVE_ID
94 elif not next((objective for objective in objectives if objective.id == self.objective), None):
95 log.warning('Objective referenced in adversary %s but not found: %s. Setting default objective.',
96 self.adversary_id, self.objective)
97 self.objective = DEFAULT_OBJECTIVE_ID
98
99 self.has_repeatable_abilities = self.check_repeatable_abilities(abilities)
100
101 def has_ability(self, ability):
102 for a in self.atomic_ordering:

Callers 2

verify_adversaryMethod · 0.80

Calls 2

nextFunction · 0.50

Tested by

no test coverage detected