Пример #1
0
 def test_handle_control_path_include_file_does_not_exist(self):
     with self.assertRaises(ValueError):
         # pylint: disable=W0212
         yaml_to_mux._handle_control_tag(
             'original_fake_file.yaml', mux.MuxTreeNode, mux.MuxTreeNode(),
             (mux.Control(
                 yaml_to_mux.YAML_INCLUDE), 'unexisting_include.yaml'))
Пример #2
0
 def test_handle_control_path_include_file_does_not_exist(self):
     with self.assertRaises(ValueError):
         yaml_to_mux._handle_control_tag(
             'original_fake_file.yaml',
             mux.MuxTreeNode, mux.MuxTreeNode(),
             (mux.Control(yaml_to_mux.YAML_INCLUDE),
              'unexisting_include.yaml'))
Пример #3
0
 def test_handle_control_path_remove(self):
     node = mux.MuxTreeNode()
     control = mux.Control(yaml_to_mux.YAML_REMOVE_NODE)
     to_be_removed = 'node_to_be_removed'
     # pylint: disable=W0212
     yaml_to_mux._handle_control_tag('fake_path', node,
                                     (control, to_be_removed))
     self.assertEqual(control.value, to_be_removed)
     self.assertIn(control, node.ctrl)
Пример #4
0
 def test_handle_control_path_remove(self):
     klass = mux.MuxTreeNode
     node = klass()
     control = mux.Control(yaml_to_mux.YAML_REMOVE_NODE)
     to_be_removed = 'node_to_be_removed'
     yaml_to_mux._handle_control_tag('fake_path', klass, node,
                                     (control, to_be_removed))
     self.assertEqual(control.value, to_be_removed)
     self.assertIn(control, node.ctrl)
Пример #5
0
 def test_handle_control_path_remove(self):
     klass = mux.MuxTreeNode
     node = klass()
     control = mux.Control(yaml_to_mux.YAML_REMOVE_NODE)
     to_be_removed = 'node_to_be_removed'
     yaml_to_mux._handle_control_tag('fake_path',
                                     klass, node,
                                     (control, to_be_removed))
     self.assertEqual(control.value, to_be_removed)
     self.assertIn(control, node.ctrl)