本文整理汇总了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)
示例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)
示例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)
示例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)
示例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
示例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)
示例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)
示例8: test_poll_setup
def test_poll_setup(self):
testutils.assertNotRaises(self.poller.poll_setup)
示例9: test_poll_host_groups
def test_poll_host_groups(self):
testutils.assertNotRaises(self.poller.poll_host_groups)
示例10: test_start_dispatcher
def test_start_dispatcher(self):
self.__main_plugin._HapiProcessor__dispatcher = DispatcherForTest()
testutils.assertNotRaises(self.__main_plugin.start_dispatcher)
示例11: test_poll
def test_poll(self):
testutils.assertNotRaises(self.poller.poll)
示例12: test_request_exit
def test_request_exit(self):
testutils.assertNotRaises(self.__main_plugin.request_exit)
示例13: test_start_receiver
def test_start_receiver(self):
testutils.assertNotRaises(self.__main_plugin.start_receiver)
示例14: test_ensure_connection
def test_ensure_connection(self):
comm = CommonForTest()
testutils.assertNotRaises(comm.ensure_connection)
示例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())