Пример #1
0
 def test_inherence_2(self):
     c = cnode.from_dict({'k1': {'k2': {'k3': 'v1'}, 'k4': 'v2'}})
     cv = view.CView(c, view.base_node(c, 'k1/k2'))
     self.assertEqual(cv['k4'], 'v2')
Пример #2
0
 def test_none(self):
     cv = view.CView(self.c)
     self.assertIsNone(cv['aaa'])
Пример #3
0
 def test_none_path(self):
     cv = view.CView(self.c)
     self.assertIsNone(cv['aaa/bbb'])
Пример #4
0
 def test_name(self):
     cv = view.CView(self.c)
     self.assertEqual(cv['k2/k2_1'], 'v2_1')
Пример #5
0
 def test_inherence(self):
     cv = view.CView(self.c, view.base_node(self.c, 'k3/k3_1'))
     self.assertEqual(cv['k3_2'], 'v3_0')
Пример #6
0
 def test_basepath2(self):
     cv = view.CView(self.c, view.base_node(self.c, 'k3/k3_1'))
     self.assertEqual(cv['k3_3_1'], 'v_3')
Пример #7
0
 def test_basepath1(self):
     cv = view.CView(self.c, view.base_node(self.c, 'k2'))
     self.assertEqual(cv['k2_1'], 'v2_1')
Пример #8
0
 def test_basic_dict(self):
     cv = view.CView(self.c)
     self.assertEqual(cv['k1'], 'v1')
     self.assertEqual(cv['k2']['k2_1'], 'v2_1')
     self.assertEqual(cv['k2']['k2_2'], 'v2_2')
     self.assertEqual(cv['k3']['k3_1']['k3_3_1'], 'v_3')