Exemple #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')
Exemple #2
0
 def test_none(self):
     cv = view.CView(self.c)
     self.assertIsNone(cv['aaa'])
Exemple #3
0
 def test_none_path(self):
     cv = view.CView(self.c)
     self.assertIsNone(cv['aaa/bbb'])
Exemple #4
0
 def test_name(self):
     cv = view.CView(self.c)
     self.assertEqual(cv['k2/k2_1'], 'v2_1')
Exemple #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')
Exemple #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')
Exemple #7
0
 def test_basepath1(self):
     cv = view.CView(self.c, view.base_node(self.c, 'k2'))
     self.assertEqual(cv['k2_1'], 'v2_1')
Exemple #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')