Ejemplo n.º 1
0
 def test_node_invalid(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_target_valuewise(reporter, self.state, TARGET_TYPE_NODE,
                                    "rh7-x")
     report = [(severity.ERROR, report_codes.NODE_NOT_FOUND, {
         "node": "rh7-x",
     }, report_codes.FORCE_NODE_DOES_NOT_EXIST)]
     assert_report_item_list_equal(reporter.report_item_list, report)
Ejemplo n.º 2
0
 def test_node_invalid_not_forceable(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_target_valuewise(reporter,
                                    self.state,
                                    TARGET_TYPE_NODE,
                                    "rh7-x",
                                    allow_force=False)
     report = [(severity.ERROR, report_codes.NODE_NOT_FOUND, {
         "node": "rh7-x",
     }, None)]
     assert_report_item_list_equal(reporter.report_item_list, report)
Ejemplo n.º 3
0
 def test_node_invalid_force(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_target_valuewise(reporter,
                                    self.state,
                                    TARGET_TYPE_NODE,
                                    "rh7-x",
                                    force_node=True)
     report = [(severity.WARNING, report_codes.NODE_NOT_FOUND, {
         "node": "rh7-x",
     }, None)]
     assert_report_item_list_equal(reporter.report_item_list, report)
Ejemplo n.º 4
0
 def test_node_invalid_not_forceable(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_target_valuewise(
         reporter, self.state, TARGET_TYPE_NODE, "rh7-x", allow_force=False
     )
     report = [(
         severity.ERROR,
         report_codes.NODE_NOT_FOUND,
         {
             "node": "rh7-x",
         },
         None
     )]
     assert_report_item_list_equal(reporter.report_item_list, report)
Ejemplo n.º 5
0
 def test_node_invalid(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_target_valuewise(
         reporter, self.state, TARGET_TYPE_NODE, "rh7-x"
     )
     report = [(
         severity.ERROR,
         report_codes.NODE_NOT_FOUND,
         {
             "node": "rh7-x",
         },
         report_codes.FORCE_NODE_DOES_NOT_EXIST
     )]
     assert_report_item_list_equal(reporter.report_item_list, report)
Ejemplo n.º 6
0
 def test_node_invalid_force(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_target_valuewise(
         reporter, self.state, TARGET_TYPE_NODE, "rh7-x", force_node=True
     )
     report = [(
         severity.WARNING,
         report_codes.NODE_NOT_FOUND,
         {
             "node": "rh7-x",
         },
         None
     )]
     assert_report_item_list_equal(reporter.report_item_list, report)
Ejemplo n.º 7
0
 def test_node_empty(self):
     report_list = lib._validate_target_valuewise(self.state,
                                                  TARGET_TYPE_NODE, "")
     report = [(severity.ERROR, report_codes.NODE_NOT_FOUND, {
         "node": "",
     }, report_codes.FORCE_NODE_DOES_NOT_EXIST)]
     assert_report_item_list_equal(report_list, report)
Ejemplo n.º 8
0
 def test_node_valid(self):
     assert_report_item_list_equal(
         lib._validate_target_valuewise(
             self.state, TARGET_TYPE_NODE, "nodeA"
         ),
         [],
     )
Ejemplo n.º 9
0
 def test_node_invalid_not_forceable(self):
     report_list = lib._validate_target_valuewise(
         self.state, TARGET_TYPE_NODE, "rh7-x", allow_force=False
     )
     report = [
         (
             severity.ERROR,
             report_codes.NODE_NOT_FOUND,
             {"node": "rh7-x", "searched_types": [],},
             None,
         )
     ]
     assert_report_item_list_equal(report_list, report)
Ejemplo n.º 10
0
 def test_node_invalid_force(self):
     report_list = lib._validate_target_valuewise(
         self.state, TARGET_TYPE_NODE, "rh7-x", force_node=True
     )
     report = [
         (
             severity.WARNING,
             report_codes.NODE_NOT_FOUND,
             {"node": "rh7-x", "searched_types": [],},
             None,
         )
     ]
     assert_report_item_list_equal(report_list, report)
Ejemplo n.º 11
0
 def test_node_invalid(self):
     report_list = lib._validate_target_valuewise(
         self.state, TARGET_TYPE_NODE, "rh7-x"
     )
     report = [
         (
             severity.ERROR,
             report_codes.NODE_NOT_FOUND,
             {"node": "rh7-x", "searched_types": [],},
             report_codes.FORCE_NODE_DOES_NOT_EXIST,
         )
     ]
     assert_report_item_list_equal(report_list, report)
Ejemplo n.º 12
0
 def test_node_empty(self):
     state = self.get_status()
     report_list = lib._validate_target_valuewise(state, TARGET_TYPE_NODE,
                                                  "")
     report = [(
         severity.ERROR,
         report_codes.NODE_NOT_FOUND,
         {
             "node": "",
             "searched_types": [],
         },
         report_codes.FORCE,
     )]
     assert_report_item_list_equal(report_list, report)
Ejemplo n.º 13
0
 def test_node_valid(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_target_valuewise(reporter, self.state, TARGET_TYPE_NODE,
                                    "nodeA")
     assert_report_item_list_equal(reporter.report_item_list, [])
Ejemplo n.º 14
0
 def test_node_valid(self):
     reporter = MockLibraryReportProcessor()
     lib._validate_target_valuewise(
         reporter, self.state, TARGET_TYPE_NODE, "nodeA"
     )
     assert_report_item_list_equal(reporter.report_item_list, [])