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

Class TestObject

tests/api/v2/managers/test_base_api_manager.py:34–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33
34class TestObject(FirstClassObjectInterface, BaseObject):
35 __test__ = False
36
37 schema = TestSchema()
38 display_schema = TestSchema()
39
40 @property
41 def unique(self):
42 return self.hash('%s' % self.name)
43
44 def __init__(self, name, value=''):
45 super().__init__()
46 self.name = name
47 self.value = value
48
49 def store(self, ram):
50 ram_key = 'tests'
51 existing = self.retrieve(ram[ram_key], self.unique)
52 if not existing:
53 ram[ram_key].append(self)
54 return self.retrieve(ram[ram_key], self.unique)
55 existing.update('name', self.name)
56 existing.update('value', self.value)
57 return existing
58
59
60def test_find_objects(agent):

Callers 3

build_test_objectMethod · 0.85
test_replace_objectFunction · 0.85

Calls 1

TestSchemaClass · 0.85

Tested by 3

build_test_objectMethod · 0.68
test_replace_objectFunction · 0.68