pytest-httpserver:pytest的HTTP服务器以测试HTTP客户端

时间:2021-05-05 10:37:40
【文件属性】:
文件名称:pytest-httpserver:pytest的HTTP服务器以测试HTTP客户端
文件大小:72KB
文件格式:ZIP
更新时间:2021-05-05 10:37:40
Python pytest_httpserver pytest的HTTP服务器 果壳 该库旨在帮助测试HTTP客户端,而无需联系实际的HTTP服务器。 换句话说,这是一个伪造的http服务器,可以通过localhost访问,可以使用预定义的预期http请求及其响应来启动。 例子 处理一个简单的GET请求 def test_my_client ( httpserver ): # httpserver is a pytest fixture which starts the server # set up the server to serve /foobar with the json httpserver . expect_request ( "/foobar" ). respond_with_json ({ "foo" : "bar" }) # check that the
【文件预览】:
pytest-httpserver-master
----MANIFEST.in(204B)
----codecov.yml(144B)
----CONTRIBUTION.md(3KB)
----.github()
--------workflows()
----example_pytest.py(1KB)
----.vscode()
--------settings.json(590B)
----doc()
--------background.rst(9KB)
--------howto.rst(16KB)
--------conf.py(5KB)
--------fixtures.rst(2KB)
--------changes.rst(48B)
--------index.rst(1KB)
--------Makefile(614B)
--------guide.rst(107B)
--------upgrade.rst(2KB)
--------api.rst(1KB)
--------tutorial.rst(17KB)
--------_static()
----tox.ini(256B)
----LICENSE(1KB)
----setup.cfg(107B)
----setup.py(2KB)
----CHANGES.rst(7KB)
----README.md(4KB)
----Makefile(1KB)
----release_checklist.md(698B)
----requirements-doc.txt(30B)
----tests()
--------test_urimatch.py(2KB)
--------test_with_statement.py(122B)
--------test_headers.py(4KB)
--------test_querystring.py(1KB)
--------test_wait.py(3KB)
--------test_mixed.py(3KB)
--------test_permanent.py(3KB)
--------test_json_matcher.py(2KB)
--------test_port_changing.py(1KB)
--------test_querymatcher.py(1KB)
--------assets()
--------test_ordered.py(2KB)
--------test_oneshot.py(2KB)
--------test_ssl.py(1KB)
--------conftest.py(403B)
----releasenotes()
--------notes()
----.gitignore(157B)
----example.py(392B)
----pytest_httpserver()
--------pytest_plugin.py(1KB)
--------httpserver.py(42KB)
--------__init__.py(333B)

网友评论