MCPcopy Create free account
hub / github.com/StackStorm/st2 / test_dot_notation

Method test_dot_notation

st2client/tests/unit/test_util_json.py:42–47  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

40
41class TestGetValue(unittest.TestCase):
42 def test_dot_notation(self):
43 self.assertEqual(jsutil.get_value(DOC, "a01"), 1)
44 self.assertEqual(jsutil.get_value(DOC, "c01.c11"), 3)
45 self.assertEqual(jsutil.get_value(DOC, "c01.c13.c22"), 6)
46 self.assertEqual(jsutil.get_value(DOC, "c01.c13"), {"c21": 5, "c22": 6})
47 self.assertListEqual(jsutil.get_value(DOC, "c01.c14"), [7, 8, 9])
48
49 def test_dot_notation_with_val_error(self):
50 self.assertRaises(ValueError, jsutil.get_value, DOC, None)

Callers

nothing calls this directly

Calls 1

get_valueMethod · 0.45

Tested by

no test coverage detected