本文整理汇总了Python中pyeloqua.Bulk.imports方法的典型用法代码示例。如果您正苦于以下问题:Python Bulk.imports方法的具体用法?Python Bulk.imports怎么用?Python Bulk.imports使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyeloqua.Bulk
的用法示例。
在下文中一共展示了Bulk.imports方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_export_data_notexp
# 需要导入模块: from pyeloqua import Bulk [as 别名]
# 或者: from pyeloqua.Bulk import imports [as 别名]
def test_get_export_data_notexp(mock_data):
""" get data from a synced export - exception """
bulk = Bulk(test=True)
bulk.imports('contacts')
bulk.job_def = IMPORT_JOB_DEF
mock_data.return_value = RETURN_DATA['items']
bulk.get_export_data()
示例2: test_post_data_except
# 需要导入模块: from pyeloqua import Bulk [as 别名]
# 或者: from pyeloqua.Bulk import imports [as 别名]
def test_post_data_except(mock_post):
""" post data server error """
bulk = Bulk(test=True)
bulk.imports('contacts')
bulk.job_def = IMPORT_JOB_DEF
mock_post.return_value = Mock(ok=False, status_code=400)
mock_post.return_value.json.return_value = {}
bulk.post_data(IMPORT_TEST_DATA)
示例3: test_post_data_call
# 需要导入模块: from pyeloqua import Bulk [as 别名]
# 或者: from pyeloqua.Bulk import imports [as 别名]
def test_post_data_call(mock_post):
""" post data to an import definition """
bulk = Bulk(test=True)
bulk.imports('contacts')
bulk.job_def = IMPORT_JOB_DEF
mock_post.return_value = Mock(ok=True, status_code=201)
bulk.post_data(IMPORT_TEST_DATA)
mock_post.assert_called_with(url=bulk.bulk_base + '/contacts/imports/1/data',
auth=bulk.auth,
data=dumps(IMPORT_TEST_DATA, ensure_ascii=False).encode('utf8'),
headers=POST_HEADERS)
示例4: test_get_sync_rejects_notexp
# 需要导入模块: from pyeloqua import Bulk [as 别名]
# 或者: from pyeloqua.Bulk import imports [as 别名]
def test_get_sync_rejects_notexp(mock_data):
""" get logs from a sync - exception """
bulk = Bulk(test=True)
bulk.imports('contacts')
mock_data.return_value = RETURN_SYNC_REJECTS['items']
bulk.get_sync_rejects()
示例5: test_imports_job_type
# 需要导入模块: from pyeloqua import Bulk [as 别名]
# 或者: from pyeloqua.Bulk import imports [as 别名]
def test_imports_job_type():
""" imports() sets job_type """
bulk = Bulk(test=True)
bulk.imports('contacts')
assert bulk.job['job_type'] == 'imports'