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


Python PublishQueueError.bad_schedule_error方法代码示例

本文整理汇总了Python中superdesk.errors.PublishQueueError.bad_schedule_error方法的典型用法代码示例。如果您正苦于以下问题:Python PublishQueueError.bad_schedule_error方法的具体用法?Python PublishQueueError.bad_schedule_error怎么用?Python PublishQueueError.bad_schedule_error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在superdesk.errors.PublishQueueError的用法示例。


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

示例1: test_close_subscriber_does_close

# 需要导入模块: from superdesk.errors import PublishQueueError [as 别名]
# 或者: from superdesk.errors.PublishQueueError import bad_schedule_error [as 别名]
    def test_close_subscriber_does_close(self):
        with self.app.app_context():
            subscriber = self.app.data.find("subscribers", None, None)[0]
            self.assertTrue(subscriber.get("is_active"))

            PublishService().close_transmitter(subscriber, PublishQueueError.bad_schedule_error())
            subscriber = self.app.data.find("subscribers", None, None)[0]
            self.assertFalse(subscriber.get("is_active"))
开发者ID:oxcarh,项目名称:superdesk,代码行数:10,代码来源:publish_service_tests.py

示例2: test_close_output_channel_does_close

# 需要导入模块: from superdesk.errors import PublishQueueError [as 别名]
# 或者: from superdesk.errors.PublishQueueError import bad_schedule_error [as 别名]
 def test_close_output_channel_does_close(self):
     with self.app.app_context():
         output_channel = self.app.data.find('output_channels', None, None)[1]
         self.assertTrue(output_channel.get('is_active'))
         PublishService().close_transmitter(output_channel, 'output_channels',
                                            PublishQueueError.bad_schedule_error())
         output_channel = self.app.data.find('output_channels', None, None)[1]
         self.assertFalse(output_channel.get('is_active'))
开发者ID:Flowdeeps,项目名称:superdesk-1,代码行数:10,代码来源:publish_service_tests.py

示例3: is_on_time

# 需要导入模块: from superdesk.errors import PublishQueueError [as 别名]
# 或者: from superdesk.errors.PublishQueueError import bad_schedule_error [as 别名]
def is_on_time(queue_item, destination):
    """
    Checks if the item is ready to be processed
    :param queue_item: item to be checked
    :return: True if the item is ready
    """
    try:
        if queue_item.get('publish_schedule'):
            publish_schedule = queue_item['publish_schedule']
            if type(publish_schedule) is not datetime:
                raise PublishQueueError.bad_schedule_error(Exception("Schedule is not datetime"),
                                                           destination)
            return utcnow() >= publish_schedule
        return True
    except PublishQueueError:
        raise
    except Exception as ex:
        raise PublishQueueError.bad_schedule_error(ex, destination)
开发者ID:ahilles107,项目名称:superdesk-1,代码行数:20,代码来源:publish_content.py

示例4: mock_transmit

# 需要导入模块: from superdesk.errors import PublishQueueError [as 别名]
# 或者: from superdesk.errors.PublishQueueError import bad_schedule_error [as 别名]
 def mock_transmit(*args):
     raise PublishQueueError.bad_schedule_error()
开发者ID:oxcarh,项目名称:superdesk,代码行数:4,代码来源:publish_service_tests.py


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