pytest mockservers
0.6.0
pytest-mockservers套件提供了一組固定裝置,當您需要檢查發送到 HTTP/UDP 伺服器的請求是否真正發送時,可以幫助您測試程式碼。
可用的裝置:
http_serverhttp_server_factoryunused_portunused_port_factoryunused_udp_portunused_udp_port_factoryudp_server_factory$ pip install pytest-mockservers檢視tests/*以尋找pytest-mockservers固定裝置所使用的真實範例。
要使用pytest-mockservers程式碼庫,您需要在本地複製專案並透過詩歌安裝所需的依賴項:
$ git clone [email protected]:Gr1N/pytest-mockservers.git
$ make install若要執行測試和 linter,請使用下列命令:
$ make lint && make test如果您只想執行測試或 linter,您可以明確指定要執行的測試環境,例如:
$ make lint-blackpytest-mockservers根據 MIT 許可證獲得許可。有關詳細信息,請參閱許可證文件。