MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / test_add

Method test_add

tests/utils/test_component_store.py:28–41  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

26 self.assertEqual(list(self.cs), [])
27
28 def test_add(self):
29 test_obj = object()
30
31 self.assertFalse("test_obj" in self.cs)
32
33 self.cs.add("test_obj", "Test object", test_obj)
34
35 self.assertTrue("test_obj" in self.cs)
36
37 self.assertEqual(len(self.cs), 1)
38 self.assertEqual(list(self.cs), [("test_obj", test_obj)])
39
40 self.assertEqual(self.cs.test_obj, test_obj)
41 self.assertEqual(self.cs["test_obj"], test_obj)
42
43 def test_add2(self):
44 test_obj1 = object()

Callers

nothing calls this directly

Calls 1

addMethod · 0.80

Tested by

no test coverage detected