Пример #1
0
 def test_node_missing_and_gets_created(self):
     assert_xml_equal(
         etree_to_str(
             node._ensure_node_exists(self.nodes, "name-test2", self.state)
         ),
         etree_to_str(self.node2),
     )
Пример #2
0
 def test_node_missing_and_gets_created(self):
     assert_xml_equal(
         etree_to_str(
             node._ensure_node_exists(self.nodes, "name-test2", self.state)
         ),
         etree_to_str(self.node2)
     )
Пример #3
0
 def test_node_missing_no_state(self):
     assert_raise_library_error(
         lambda: node._ensure_node_exists(self.nodes, "name-missing"),
         (severity.ERROR, report_codes.NODE_NOT_FOUND, {
             "node": "name-missing"
         }, None),
     )
Пример #4
0
 def test_node_missing_no_state(self):
     assert_raise_library_error(
         lambda: node._ensure_node_exists(self.nodes, "name-missing"),
         (
             severity.ERROR,
             report_codes.NODE_NOT_FOUND,
             {"node": "name-missing"},
             None
         ),
     )
Пример #5
0
 def test_node_missing_not_in_state(self):
     assert_raise_library_error(
         lambda: node._ensure_node_exists(
             self.nodes, "name-missing", self.state
         ),
         (
             severity.ERROR,
             report_codes.NODE_NOT_FOUND,
             {"node": "name-missing", "searched_types": []},
             None,
         ),
     )
Пример #6
0
 def test_node_already_exists(self):
     assert_xml_equal(
         etree_to_str(node._ensure_node_exists(self.nodes, "name-test1")),
         etree_to_str(self.node1)
     )
Пример #7
0
 def test_node_already_exists(self):
     assert_xml_equal(
         etree_to_str(node._ensure_node_exists(self.nodes, "name-test1")),
         etree_to_str(self.node1),
     )