• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python pyeloqua.Bulk类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyeloqua.Bulk的典型用法代码示例。如果您正苦于以下问题:Python Bulk类的具体用法?Python Bulk怎么用?Python Bulk使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: test_filter_date_badstr_end

def test_filter_date_badstr_end(mock_get):
    """ exception when bad datetime string passed - end """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = deepcopy(GOOD_CONTACT_FIELDS)
    bulk.filter_date(field='created', end='2017-01- 00:00:00')
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:7,代码来源:test_bulk_filters.py


示例2: test_leadscore_fields_noparams

def test_leadscore_fields_noparams(mock_get):
    """ add fields from a lead score model by model name """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = deepcopy(LEADSCORE_MODEL_NAME)
    bulk.add_leadscore_fields()
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:7,代码来源:test_bulk_fields.py


示例3: test_start_sync_export_nodef

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()
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:7,代码来源:test_bulk_sync.py


示例4: test_add_fields_actvty

def test_add_fields_actvty():
    """ add some activity fields """
    bulk = Bulk(test=True)
    bulk.exports('activities', act_type='EmailOpen')
    fields = ['ActivityId', 'AssetId']
    bulk.add_fields(fields)
    assert len(bulk.job['fields']) == 2
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:7,代码来源:test_bulk_fields.py


示例5: test_writebulkjob

def test_writebulkjob(mock_dump):
    """ ensure job def calls json.dump """
    bulk = Bulk(test=True)
    bulk.job = JOB_EXPORTS_CONTACTS
    mock_dump.return_value = None
    bulk.write_job('/tmp/pyeloqua_test_bulk_write.json')
    assert mock_dump.called
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:7,代码来源:test_bulk_save_job_def.py


示例6: test_asset_exists_list_none

def test_asset_exists_list_none(mock_get):
    """ add exists filter - exception on no params """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = deepcopy(GOOD_LIST_NAME)
    bulk.asset_exists(asset='lists')
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:7,代码来源:test_bulk_filters.py


示例7: test_option_add_all

def test_option_add_all():
    """ add several random options """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    bulk.add_options(identifierFieldName='C_EmailAddress',
                     areSystemTimestampsInUTC=True)
    assert len(bulk.job['options']) == 2
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:7,代码来源:test_bulk_options.py


示例8: test_leadscore_fields_name

def test_leadscore_fields_name(mock_get):
    """ add fields from a lead score model by model name """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = deepcopy(LEADSCORE_MODEL_NAME)
    bulk.add_leadscore_fields(name='Model 1')
    assert bulk.job['fields'] == LEADSCORE_MODEL_FIELDS
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:8,代码来源:test_bulk_fields.py


示例9: test_event_lnk_cntct_fields

def test_event_lnk_cntct_fields(mock_get):
    """ add some linked contact fields to event """
    bulk = Bulk(test=True)
    bulk.exports('events', 1)
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = deepcopy(GOOD_FIELDS)
    bulk.add_linked_fields('contacts', ['C_EmailAddress', 'C_FirstName'])
    assert bulk.job['fields'] == LINKED_EVENT_CONTACT_FIELDS
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:8,代码来源:test_bulk_fields.py


示例10: test_cntct_lnk_acct_fields

def test_cntct_lnk_acct_fields(mock_get):
    """ add some linked account fields """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = deepcopy(GOOD_FIELDS_ACCOUNT)
    bulk.add_linked_fields('accounts', ['M_CompanyName', 'M_Country'])
    assert bulk.job['fields'] == LINKED_ACCOUNT_FIELDS
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:8,代码来源:test_bulk_fields.py


示例11: test_accnt_system_fields_set

def test_accnt_system_fields_set(mock_get):
    """ add some account system fields """
    bulk = Bulk(test=True)
    bulk.exports('accounts')
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = deepcopy(GOOD_FIELDS)
    bulk.add_fields(['accountID', 'createdAt'])
    assert len(bulk.job['fields']) == 2
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:8,代码来源:test_bulk_fields.py


示例12: test_add_fields_notfound

def test_add_fields_notfound(mock_get):
    """ raise exception when field not found """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = deepcopy(GOOD_FIELDS)
    fields = ['C_EmailAddress', 'C_FirstName', 'C_LastName']
    bulk.add_fields(fields)
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:8,代码来源:test_bulk_fields.py


示例13: test_get_fields_specify

def test_get_fields_specify(mock_get):
    """ specify elq_object to return fields for """
    bulk = Bulk(test=True)
    bulk.exports('accounts')
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = deepcopy(GOOD_FIELDS)
    fields = bulk.get_fields(elq_object='contacts')
    assert fields == ALL_CONTACT_FIELDS
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:8,代码来源:test_bulk_fields.py


示例14: test_create_imports_error

def test_create_imports_error(mock_post):
    """ raise exception on bad import def """
    bulk = Bulk(test=True)
    bulk.job = JOB_IMPORTS_CONTACTS_BAD
    mock_post.return_value = Mock(ok=True, status_code=400)
    mock_post.return_value.json.return_value = deepcopy(
        IMPORT_JOB_RESPONSE_BAD)
    bulk.create_def('test name')
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:8,代码来源:test_bulk_def.py


示例15: test_get_export_data_rt

def test_get_export_data_rt(mock_data):
    """ get data from a synced export - return data """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    bulk.job_def = EXPORT_JOB_DEF
    mock_data.return_value = RETURN_DATA['items']
    data = bulk.get_export_data()
    assert data == RETURN_DATA['items']
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:8,代码来源:test_bulk_getdata.py


示例16: test_filter_value_equal

def test_filter_value_equal(mock_get):
    """ add field filter by value equal """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = deepcopy(GOOD_CONTACT_FIELDS)
    bulk.filter_equal(field='contactID', value='12345')
    assert bulk.job['filters'][0] == " '{{Contact.Id}}' = '12345' "
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:8,代码来源:test_bulk_filters.py


示例17: test_create_imports_setdef

def test_create_imports_setdef(mock_post):
    """ set job_def for create import """
    bulk = Bulk(test=True)
    bulk.job = JOB_IMPORTS_CONTACTS
    mock_post.return_value = Mock(ok=True, status_code=201)
    mock_post.return_value.json.return_value = deepcopy(IMPORT_JOB_RESPONSE)
    bulk.create_def('test name')
    assert bulk.job_def == IMPORT_JOB_RESPONSE
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:8,代码来源:test_bulk_def.py


示例18: test_asset_exists_list_id

def test_asset_exists_list_id(mock_get):
    """ add exists filter - Shared List by ID """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = deepcopy(GOOD_LIST_ID)
    bulk.asset_exists(asset='lists', asset_id=1)
    assert bulk.job['filters'][0] == " EXISTS('{{ContactList[1]}}') "
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:8,代码来源:test_bulk_filters.py


示例19: test_get_sync_rejects_rt

def test_get_sync_rejects_rt(mock_data):
    """ get logs from a sync - return data """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    bulk.job_sync = SYNC_RESPONSE_SUCCESS
    mock_data.return_value = RETURN_SYNC_REJECTS['items']
    data = bulk.get_sync_rejects()
    assert data == RETURN_SYNC_REJECTS['items']
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:8,代码来源:test_bulk_getdata.py


示例20: test_get_fields_cntcts_return

def test_get_fields_cntcts_return(mock_get):
    """ find all contact fields - return correct items """
    bulk = Bulk(test=True)
    bulk.exports('contacts')
    mock_get.return_value = Mock(ok=True, status_code=200)
    mock_get.return_value.json.return_value = deepcopy(GOOD_FIELDS)
    fields = bulk.get_fields()
    assert fields == ALL_CONTACT_FIELDS
开发者ID:colemanja91,项目名称:pyeloqua,代码行数:8,代码来源:test_bulk_fields.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pyemd.emd函数代码示例发布时间:2022-05-25
下一篇:
Python openssl.OpenSSL类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap