コード例 #1
0
 def test_one_nonexistant(self):
     report_list = []
     resource = common.find_one_resource_and_report(self.cib, "R-missing",
                                                    report_list)
     self.assertIsNone(resource)
     assert_report_item_list_equal(report_list, [
         fixture.report_not_found("R-missing", context_type="resources"),
     ])
コード例 #2
0
 def test_one_additional_search(self):
     report_list = []
     resource = common.find_one_resource_and_report(
         self.cib,
         "R1",
         report_list,
         additional_search=self.additional_search,
     )
     self.assertEqual("R1x", resource.attrib.get("id"))
     assert_report_item_list_equal(report_list, [])
コード例 #3
0
 def test_one_existing(self):
     report_list = []
     resource = common.find_one_resource_and_report(
         self.cib,
         "R1",
         report_list
     )
     self.assertEqual("R1", resource.attrib.get("id"))
     assert_report_item_list_equal(
         report_list,
         []
     )
コード例 #4
0
 def test_one_additional_search(self):
     report_list = []
     resource = common.find_one_resource_and_report(
         self.cib,
         "R1",
         report_list,
         additional_search=self.additional_search,
     )
     self.assertEqual("R1x", resource.attrib.get("id"))
     assert_report_item_list_equal(
         report_list,
         []
     )
コード例 #5
0
 def test_one_nonexistant(self):
     report_list = []
     resource = common.find_one_resource_and_report(
         self.cib,
         "R-missing",
         report_list
     )
     self.assertIsNone(resource)
     assert_report_item_list_equal(
         report_list,
         [
             fixture.report_not_found("R-missing", context_type="resources"),
         ]
     )
コード例 #6
0
ファイル: relations.py プロジェクト: miladalipour99/pcs
 def _get_resource_el(self, res_id: str) -> Element:
     # client of this class should ensure that res_id really exists in CIB,
     # so here we don't need to handle possible reports
     return common.find_one_resource_and_report(self._resources_section,
                                                res_id, [])
コード例 #7
0
 def test_one_existing(self):
     report_list = []
     resource = common.find_one_resource_and_report(self.cib, "R1",
                                                    report_list)
     self.assertEqual("R1", resource.attrib.get("id"))
     assert_report_item_list_equal(report_list, [])