• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python testutils.assertNotRaises函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: test_poll_events

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


示例17: test_constructor

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


示例18: test_poll_host_group_membership

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


示例19: test_messenger

 def test_messenger(self):
     messenger = testutils.get_priv_attr(self.receiver, "__messenger")
     testutils.assertNotRaises(messenger, None, "test_message")
开发者ID:AokiTakumi,项目名称:hatohol,代码行数:3,代码来源:TestHaplib.py


示例20: test_messenger_get_broken_error

 def test_messenger_get_broken_error(self):
     messenger = testutils.get_priv_attr(self.receiver, "__messenger")
     testutils.assertNotRaises(messenger, None, '{"error": "test"}')
开发者ID:AokiTakumi,项目名称:hatohol,代码行数:3,代码来源:TestHaplib.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python testutils.client_from_wsdl函数代码示例发布时间:2022-05-27
下一篇:
Python testutil.FakeSource类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap