从http交互测试到数据帧处理。
pytest-vcrpandas的Python项目详细描述
……图片::https://travis-ci.com/gjeusel/pytest-vcrpandas.svg?branch=master
:目标:https://travis ci.com/gjeusel/pytest vcrpandas
。图片::https://readthedocs.org/projects/pytest-vcrpandas/badge/?version=latest
:目标:http://pytest-vcrpandas.readthedocs.io/en/latest/?徽章=最新
:alt:文档状态
…图像::https://codecov.io/gh/gjeusel/pytest vcrpandas/branch/master/graph/badge.svg
:目标:https://codecov.io/gh/gjeusel/pytest vcrpandas
。图片::https://badge.fury.io/py/py/pytestvcrpmandas.svg
:target:http://pypi.pypypypi.org/pypi/pytestvcrpmandas/
:alt:pypi包
===============
==============================================='vcrpy<;https://github.com/kevin1024/vcrpy>;``带
`pandas<;https://github.com/pandas dev/pandas>;``不仅模拟您的http交互,
,还测试您的后处理工作,以获得pandas数据帧。
代码::python
记录器(DF)
…代码::bash
第一次调用pytest生成样本
>;pytest--vcr record=“new廑sceps”
这是通过
第一次http交互获得的响应。
-a*meteo-get-u-wind-speed.pickle*用于比较
模拟响应到pandas数据帧的格式,包括类型。
代码::bash
advanced usage
----
>要配置vcr,请执行以下操作:
。代码::python
@pytest.fixture
def my_vcrpandas(vcrpandas):
custom_vcr_config=dict(
serializer='json',
casted_library_dir='fixtures/myclient/casteds',
match_on=['uri','method',
filter_headers=['authorization',从http头过滤信息
filter_u query戋u parameters=['api戋key',戋http查询字符串中的筛选信息
filter戋u post戋u data戋u parameters=['client戋u secret',戋http post data中的筛选信息
vcrpandas.config.update(custom戋vcr戋config)
return vcrpandas
My_vcrpandas(“random_bucket_name”)作为记录器:
recorder(cl.get_stuff())
请参阅“vcr配置”lt;https://vcrpy.readthedocs.io/en/latest/configuration.html`,以及“vcr高级功能”lt;https://vcrpy.readthedocs.io/en/latest/advanced.html>;```以获取
完整的选项列表。
:目标:https://travis ci.com/gjeusel/pytest vcrpandas
。图片::https://readthedocs.org/projects/pytest-vcrpandas/badge/?version=latest
:目标:http://pytest-vcrpandas.readthedocs.io/en/latest/?徽章=最新
:alt:文档状态
…图像::https://codecov.io/gh/gjeusel/pytest vcrpandas/branch/master/graph/badge.svg
:目标:https://codecov.io/gh/gjeusel/pytest vcrpandas
。图片::https://badge.fury.io/py/py/pytestvcrpmandas.svg
:target:http://pypi.pypypypi.org/pypi/pytestvcrpmandas/
:alt:pypi包
===============
==============================================='vcrpy<;https://github.com/kevin1024/vcrpy>;``带
`pandas<;https://github.com/pandas dev/pandas>;``不仅模拟您的http交互,
,还测试您的后处理工作,以获得pandas数据帧。
代码::python
记录器(DF)
…代码::bash
第一次调用pytest生成样本
>;pytest--vcr record=“new廑sceps”
这是通过
第一次http交互获得的响应。
-a*meteo-get-u-wind-speed.pickle*用于比较
模拟响应到pandas数据帧的格式,包括类型。
代码::bash
advanced usage
----
>要配置vcr,请执行以下操作:
。代码::python
@pytest.fixture
def my_vcrpandas(vcrpandas):
custom_vcr_config=dict(
serializer='json',
casted_library_dir='fixtures/myclient/casteds',
match_on=['uri','method',
filter_headers=['authorization',从http头过滤信息
filter_u query戋u parameters=['api戋key',戋http查询字符串中的筛选信息
filter戋u post戋u data戋u parameters=['client戋u secret',戋http post data中的筛选信息
vcrpandas.config.update(custom戋vcr戋config)
return vcrpandas
My_vcrpandas(“random_bucket_name”)作为记录器:
recorder(cl.get_stuff())
请参阅“vcr配置”lt;https://vcrpy.readthedocs.io/en/latest/configuration.html`,以及“vcr高级功能”lt;https://vcrpy.readthedocs.io/en/latest/advanced.html>;```以获取
完整的选项列表。