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

Method store

app/objects/c_adversary.py:73–85  ·  view source on GitHub ↗
(self, ram)

Source from the content-addressed store, hash-verified

71 self.plugin = plugin
72
73 def store(self, ram):
74 existing = self.retrieve(ram['adversaries'], self.unique)
75 if not existing:
76 ram['adversaries'].append(self)
77 return self.retrieve(ram['adversaries'], self.unique)
78 existing.update('name', self.name)
79 existing.update('description', self.description)
80 existing.update('atomic_ordering', self.atomic_ordering)
81 existing.update('objective', self.objective)
82 existing.update('tags', self.tags)
83 existing.update('has_repeatable_abilities', self.check_repeatable_abilities(ram['abilities']))
84 existing.update('plugin', self.plugin)
85 return existing
86
87 def verify(self, log, abilities, objectives):
88 for ability_id in self.atomic_ordering:

Callers 1

test_store_existingMethod · 0.95

Calls 3

retrieveMethod · 0.80
updateMethod · 0.80

Tested by 1

test_store_existingMethod · 0.76