当前位置: 首页>>代码示例>>Python>>正文


Python testutils.assertNotRaises函数代码示例

本文整理汇总了Python中testutils.assertNotRaises函数的典型用法代码示例。如果您正苦于以下问题:Python assertNotRaises函数的具体用法?Python assertNotRaises怎么用?Python assertNotRaises使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了assertNotRaises函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_put_history

 def test_put_history(self):
     self.reply_queue.put(True)
     fetch_id = 543
     item_id = 111
     samples = [{"value": "123", "time": "20150321151321"}]
     testutils.assertNotRaises(self.processor.put_history,
                            samples, item_id, fetch_id)
开发者ID:nanuyokakinu,项目名称:hatohol,代码行数:7,代码来源:TestHaplib.py

示例2: test_hap_update_monitoring_server_info

 def test_hap_update_monitoring_server_info(self):
     test_params = {"serverId": None, "url": None, "nickName": None,
                    "userName": None, "password": None,
                    "pollingIntervalSec": None, "retryIntervalSec": None,
                    "extendedInfo": None, "type": None}
     testutils.assertNotRaises(self.__main_plugin.hap_update_monitoring_server_info,
                            test_params)
开发者ID:nanuyokakinu,项目名称:hatohol,代码行数:7,代码来源:TestHaplib.py

示例3: test_acknowledge

 def test_acknowledge(self):
     destination_queue = DummyQueue()
     test_id = "test"
     self.__dispatcher.attach_destination(destination_queue, test_id)
     acknowledge = testutils.get_priv_attr(self.__dispatcher, "__acknowledge")
     test_message = (test_id, 1)
     testutils.assertNotRaises(acknowledge, test_message)
开发者ID:AokiTakumi,项目名称:hatohol,代码行数:7,代码来源:TestHaplib.py

示例4: test_load_transporter

    def test_load_transporter(self):
        test_transport_arguments = namedtuple("transport_argument",
                                              "transporter_module transporter")
        test_transport_arguments.transporter_module = "hatohol.haplib"
        test_transport_arguments.transporter = "RabbitMQHapiConnector"

        testutils.assertNotRaises(haplib.Utils.load_transporter,
                               test_transport_arguments)
开发者ID:oddmutou,项目名称:hatohol,代码行数:8,代码来源:TestHaplib.py

示例5: test_poll_in_block

 def test_poll_in_block(self):
     poll_in_try_block = testutils.get_priv_attr(self.poller, "__poll_in_try_block")
     arm_info = haplib.ArmInfo()
     self.poller.set_dispatch_queue(DummyQueue())
     self.poller._HapiProcessor__reply_queue = DummyQueue()
     org_q = self.poller._BasePoller__command_queue._CommandQueue__q
     self.poller._BasePoller__command_queue._CommandQueue__q = DummyCommandQueue()
     testutils.assertNotRaises(poll_in_try_block, arm_info)
     self.poller._BasePoller__command_queue._CommandQueue__q = org_q
开发者ID:AokiTakumi,项目名称:hatohol,代码行数:9,代码来源:TestHaplib.py

示例6: test_dispatch_receive_id_notification

 def test_dispatch_receive_id_notification(self):
     destination_queue = DummyQueue()
     test_id = "test"
     test_contents = 1
     test_message = (test_id, test_contents)
     dispatch_queue = testutils.get_priv_attr(self.__dispatcher, "__dispatch_queue")
     dispatch_queue.put(test_message)
     self.__dispatcher.attach_destination(destination_queue, test_id)
     dispatch = testutils.get_priv_attr(self.__dispatcher, "__dispatch")
     testutils.assertNotRaises(dispatch)
开发者ID:AokiTakumi,项目名称:hatohol,代码行数:10,代码来源:TestHaplib.py

示例7: test_dispatch_receive_response

    def test_dispatch_receive_response(self):
        destination_queue = DummyQueue()
        test_id = "test"
        test_contents = haplib.ParsedMessage()
        test_contents.message_id = 1

        self.__dispatcher.attach_destination(destination_queue, test_id)
        acknowledge = testutils.get_priv_attr(self.__dispatcher, "__acknowledge")
        test_message = (test_id, test_contents.message_id)
        acknowledge(test_message)

        test_message = (test_id, test_contents)
        dispatch_queue = testutils.get_priv_attr(self.__dispatcher, "__dispatch_queue")
        dispatch_queue.put(test_message)

        testutils.assertNotRaises(acknowledge, test_message)
        dispatch = testutils.get_priv_attr(self.__dispatcher, "__dispatch")
        testutils.assertNotRaises(dispatch)
开发者ID:AokiTakumi,项目名称:hatohol,代码行数:18,代码来源:TestHaplib.py

示例8: test_poll_setup

 def test_poll_setup(self):
     testutils.assertNotRaises(self.poller.poll_setup)
开发者ID:AokiTakumi,项目名称:hatohol,代码行数:2,代码来源:TestHaplib.py

示例9: test_poll_host_groups

 def test_poll_host_groups(self):
     testutils.assertNotRaises(self.poller.poll_host_groups)
开发者ID:AokiTakumi,项目名称:hatohol,代码行数:2,代码来源:TestHaplib.py

示例10: test_start_dispatcher

 def test_start_dispatcher(self):
     self.__main_plugin._HapiProcessor__dispatcher = DispatcherForTest()
     testutils.assertNotRaises(self.__main_plugin.start_dispatcher)
开发者ID:AokiTakumi,项目名称:hatohol,代码行数:3,代码来源:TestHaplib.py

示例11: test_poll

 def test_poll(self):
     testutils.assertNotRaises(self.poller.poll)
开发者ID:AokiTakumi,项目名称:hatohol,代码行数:2,代码来源:TestHaplib.py

示例12: test_request_exit

 def test_request_exit(self):
     testutils.assertNotRaises(self.__main_plugin.request_exit)
开发者ID:AokiTakumi,项目名称:hatohol,代码行数:2,代码来源:TestHaplib.py

示例13: test_start_receiver

 def test_start_receiver(self):
     testutils.assertNotRaises(self.__main_plugin.start_receiver)
开发者ID:AokiTakumi,项目名称:hatohol,代码行数:2,代码来源:TestHaplib.py

示例14: test_ensure_connection

 def test_ensure_connection(self):
     comm = CommonForTest()
     testutils.assertNotRaises(comm.ensure_connection)
开发者ID:Mnakagawa,项目名称:hatohol,代码行数:3,代码来源:TestHap2NagiosLivestatus.py

示例15: test_put_arm_info

 def test_put_arm_info(self):
     hapiproc, connector = self.__create_test_instance(ConnectorForTest)
     hapiproc.get_reply_queue().put(True)
     testutils.assertNotRaises(hapiproc.put_arm_info, haplib.ArmInfo())
开发者ID:AokiTakumi,项目名称:hatohol,代码行数:4,代码来源:TestHaplib.py


注:本文中的testutils.assertNotRaises函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。