本文整理汇总了Python中pyeloqua.Bulk.filter_date方法的典型用法代码示例。如果您正苦于以下问题:Python Bulk.filter_date方法的具体用法?Python Bulk.filter_date怎么用?Python Bulk.filter_date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyeloqua.Bulk
的用法示例。
在下文中一共展示了Bulk.filter_date方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_filter_date_badstr_end
# 需要导入模块: from pyeloqua import Bulk [as 别名]
# 或者: from pyeloqua.Bulk import filter_date [as 别名]
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')
示例2: test_filter_date_end
# 需要导入模块: from pyeloqua import Bulk [as 别名]
# 或者: from pyeloqua.Bulk import filter_date [as 别名]
def test_filter_date_end(mock_get):
""" add field filter by ending date """
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='createdAt', end='2017-01-01 00:00:00')
assert bulk.job['filters'][
0] == " '{{Contact.CreatedAt}}' <= '2017-01-01 00:00:00' "
示例3: test_filter_datetime_start
# 需要导入模块: from pyeloqua import Bulk [as 别名]
# 或者: from pyeloqua.Bulk import filter_date [as 别名]
def test_filter_datetime_start(mock_get):
""" add field filter by stating datetime """
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)
dtime = datetime.strptime('2017-01-01 00:00:00', '%Y-%m-%d %H:%M:%S')
bulk.filter_date(field='createdAt', start=dtime)
assert bulk.job['filters'][
0] == " '{{Contact.CreatedAt}}' >= '2017-01-01 00:00:00' "