1 Star 0 Fork 6

LMonster/rebate

forked from 拒海/rebate 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
test_jd.py 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
张彦 提交于 2021-06-11 11:33 . initiate
# -*- coding: utf-8 -*-
import logging
import json
from lib import logging_config
from jd.api import transform_url, elite_item_query, order_query
from jd.service import import_and_clean
from jd.cache import cache
log = logging.getLogger('refusea.test.jd')
def test_transform_url():
"""转链"""
url = 'https://item.jd.com/3639922.html'
purl = transform_url(url, sub_uid='1001')
log.debug('%s >>> %s', url, purl)
def test_elite_item_query():
"""精选商品查询"""
eid = 25
result = elite_item_query(eid, page=1)
if result:
for item in result:
log.debug(item)
def test_order_query():
"""订单查询"""
result = order_query('2021-06-05 10:30:00', '2021-06-05 11:30:00')
log.debug(json.dumps(result, ensure_ascii=False, sort_keys=True, indent=2))
def test_import_and_clean():
"""商品入库和过期清理"""
result = import_and_clean()
log.debug(result)
if __name__ == "__main__":
log.debug('--------------------- test ---------------------')
# test_transform_url()
# test_elite_item_query()
# test_order_query()
test_import_and_clean()
log.debug('--------------------- done ---------------------')
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/lmonster-box/rebate.git
git@gitee.com:lmonster-box/rebate.git
lmonster-box
rebate
rebate
master

搜索帮助