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

Method test_dict_compose

tests/transforms/compose/test_compose.py:69–86  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

67 self.assertEqual(c(""), "abab")
68
69 def test_dict_compose(self):
70
71 def a(d):
72 d = dict(d)
73 d["a"] += 1
74 return d
75
76 def b(d):
77 d = dict(d)
78 d["b"] += 1
79 return d
80
81 transforms = [a, b, a, b, a]
82 data = {"a": 0, "b": 0}
83 expected = {"a": 3, "b": 2}
84
85 self.assertDictEqual(mt.Compose(transforms)(data), expected)
86 self.assertDictEqual(execute_compose(data, transforms), expected)
87
88 def test_list_dict_compose(self):
89

Callers

nothing calls this directly

Calls 1

execute_composeFunction · 0.90

Tested by

no test coverage detected