コード例 #1
0
 def test_hge_restlib_exception_formated_msg(self):
     utils.log.set_expected_msg(self.msg)
     utils.handle_gui_exception(
         connection.RestlibException(409, "very clean"), self.formatted_msg,
         None)
     self.assertEqual(utils.log.expected_msg, self.msg)
コード例 #2
0
 def test_hge_restlib_exception_url_msg(self):
     utils.log.set_expected_msg(self.msg)
     utils.handle_gui_exception(
         connection.RestlibException(404, "page not found"),
         self.msg_with_url, None)
     self.assertEqual(utils.log.expected_msg, self.msg)
コード例 #3
0
 def stub_unbind(uuid, pool_id):
     if pool_id == 'does_not_exist_d015dea0adf560152':
         raise connection.RestlibException(400, 'Error')
コード例 #4
0
 def stub_unbind(uuid, serial):
     if serial == 'does_not_exist_1394':
         raise connection.RestlibException(400, 'Error')
コード例 #5
0
 def test_hge_restlib_exception_url_msg_500(self):
     utils.handle_gui_exception(connection.RestlibException(500, "internal server error"),
                                self.msg_with_url, None, format_msg=True)
コード例 #6
0
 def test_he_restlib_exception(self):
     e = connection.RestlibException(404, "this is a msg")
     try:
         managercli.handle_exception("huh", e)
     except SystemExit, e:
         self.assertEquals(e.code, -1)
コード例 #7
0
 def test_hge_restlib_exception_url_msg_with_formatting_format_msg_false(self):
     utils.handle_gui_exception(connection.RestlibException(404, "page not found"),
                                self.msg_with_url_and_formatting, None,
                                format_msg=False)
コード例 #8
0
 def test_hge_restlib_exception_unformatted_msg_format_msg_false(self):
     utils.log.set_expected_msg(self.msg)
     utils.handle_gui_exception(connection.RestlibException(421, "whatever"),
                                self.msg, None,
                                format_msg=False)
コード例 #9
0
 def test_hge_restlib_exception_unformatted_msg(self):
     utils.log.set_expected_msg(self.msg)
     utils.handle_gui_exception(connection.RestlibException(421, "whatever"),
                                self.msg, None)
     self.assertEqual(utils.log.expected_msg, self.msg)
コード例 #10
0
 def stub_unbind(uuid, serial):
     if serial == "does_not_exist_1394":
         raise connection.RestlibException(400, "Error")
コード例 #11
0
 def test_he_restlib_exception(self):
     e = connection.RestlibException(404, "this is a msg")
     try:
         handle_exception("huh", e)
     except SystemExit as e:
         self.assertEqual(e.code, os.EX_SOFTWARE)