本文整理汇总了Python中pyeloqua.Bulk.check_sync方法的典型用法代码示例。如果您正苦于以下问题:Python Bulk.check_sync方法的具体用法?Python Bulk.check_sync怎么用?Python Bulk.check_sync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyeloqua.Bulk
的用法示例。
在下文中一共展示了Bulk.check_sync方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_check_sync_update
# 需要导入模块: from pyeloqua import Bulk [as 别名]
# 或者: from pyeloqua.Bulk import check_sync [as 别名]
def test_check_sync_update(mock_get):
""" check on status of 'active' sync - update job_sync """
bulk = Bulk(test=True)
bulk.exports('contacts')
bulk.job_sync = SYNC_RESPONSE
mock_get.return_value = Mock(ok=True, status_code=200)
mock_get.return_value.json.return_value = SYNC_RESPONSE_ACTIVE
bulk.check_sync()
assert bulk.job_sync == SYNC_RESPONSE_ACTIVE
示例2: test_check_sync_call
# 需要导入模块: from pyeloqua import Bulk [as 别名]
# 或者: from pyeloqua.Bulk import check_sync [as 别名]
def test_check_sync_call(mock_get):
""" check on status of 'active' sync - api call """
bulk = Bulk(test=True)
bulk.exports('contacts')
bulk.job_sync = SYNC_RESPONSE
mock_get.return_value = Mock(ok=True, status_code=200)
mock_get.return_value.json.return_value = SYNC_RESPONSE_ACTIVE
bulk.check_sync()
mock_get.assert_called_with(url=bulk.bulk_base + '/syncs/1',
auth=bulk.auth)
示例3: test_check_sync_error
# 需要导入模块: from pyeloqua import Bulk [as 别名]
# 或者: from pyeloqua.Bulk import check_sync [as 别名]
def test_check_sync_error(mock_get):
""" check on status of 'error' sync - return True """
bulk = Bulk(test=True)
bulk.exports('contacts')
bulk.job_sync = SYNC_RESPONSE
mock_get.return_value = Mock(ok=True, status_code=200)
mock_get.return_value.json.return_value = SYNC_RESPONSE_ERROR
status = bulk.check_sync()
assert status is True
示例4: test_check_sync_notfinished
# 需要导入模块: from pyeloqua import Bulk [as 别名]
# 或者: from pyeloqua.Bulk import check_sync [as 别名]
def test_check_sync_notfinished(mock_get):
""" check on status of 'active' sync - return False """
bulk = Bulk(test=True)
bulk.exports('contacts')
bulk.job_sync = SYNC_RESPONSE
mock_get.return_value = Mock(ok=True, status_code=200)
mock_get.return_value.json.return_value = SYNC_RESPONSE_ACTIVE
status = bulk.check_sync()
assert status is False