本文整理汇总了Python中pyeloqua.Bulk.start_sync方法的典型用法代码示例。如果您正苦于以下问题:Python Bulk.start_sync方法的具体用法?Python Bulk.start_sync怎么用?Python Bulk.start_sync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyeloqua.Bulk
的用法示例。
在下文中一共展示了Bulk.start_sync方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_start_sync_export_nodef
# 需要导入模块: from pyeloqua import Bulk [as 别名]
# 或者: from pyeloqua.Bulk import start_sync [as 别名]
def test_start_sync_export_nodef(mock_post):
""" except when no job_def """
bulk = Bulk(test=True)
bulk.exports('contacts')
mock_post.return_value = Mock(ok=True, status_code=200)
mock_post.return_value.json.return_value = deepcopy(SYNC_RESPONSE)
bulk.start_sync()
示例2: test_start_sync_export_add
# 需要导入模块: from pyeloqua import Bulk [as 别名]
# 或者: from pyeloqua.Bulk import start_sync [as 别名]
def test_start_sync_export_add(mock_post):
""" start syncing an export - add to Bulk """
bulk = Bulk(test=True)
bulk.exports('contacts')
bulk.job_def = EXPORT_JOB_DEF
mock_post.return_value = Mock(ok=True, status_code=200)
mock_post.return_value.json.return_value = deepcopy(SYNC_RESPONSE)
bulk.start_sync()
assert bulk.job_sync == SYNC_RESPONSE
示例3: test_start_sync_export
# 需要导入模块: from pyeloqua import Bulk [as 别名]
# 或者: from pyeloqua.Bulk import start_sync [as 别名]
def test_start_sync_export(mock_post):
""" start syncing an export - api call """
bulk = Bulk(test=True)
bulk.exports('contacts')
bulk.job_def = EXPORT_JOB_DEF
mock_post.return_value = Mock(ok=True, status_code=200)
mock_post.return_value.json.return_value = deepcopy(SYNC_RESPONSE)
bulk.start_sync()
mock_post.assert_called_with(url=bulk.bulk_base + '/syncs',
auth=bulk.auth,
data=dumps(
{
"syncedInstanceUri": "/contacts/exports/1"
},
ensure_ascii=False).encode('utf8'),
headers=POST_HEADERS)