im-swagger-spy
pytest plugin for matching methods in swagger with those used in tests
Установка
pip install git+https://github.com/dasshit/im-swagger-spy.git
Использование
Есть несколько вариантов использования
Вариант №1
pytest.ini
[pytest]
addopts = --swagger-url http://localhost/client/v101/u/api.yaml # Адрес, с которого можно получить swagger.json|yaml или openapi.json|yaml
--swagger-prefix /api/v101 # Префикс к path методов из документации
--swagger-name test.ru # Название сервиса (для отчета)
--swagger-report reports/ # Путь к папке для сохранения отчета
conftest.py
import pytest
import requests
@pytest.fixture(scope='session')
def session(swagger_http_spy):
session = requests.Session()
swagger_http_spy.register_as_hook(session)
yield session # Запросы этой сессии попадут в отчет
CI
pytest tests/
python -m im_swagger_spy build
Другие примеры
Можно посмотреть в example/
Metadata
Release files for im-swagger-spy 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| im_swagger_spy-0.4.0.tar.gz | 10.4 kB | Without provenance | Details for im_swagger_spy-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| im_swagger_spy-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for im_swagger_spy-0.4.0-py3-none-any.whl |
Total release size: 21.0 kB
Release files / im_swagger_spy-0.4.0.tar.gz
| Download URL | im_swagger_spy-0.4.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d88a5eab795e2b73fee6249f08b87fb0ac308c90ea96eef55c5164ce655b6c82
|
|
BLAKE2b-256 checksum How to use checksums |
31dca9c06b03b40cca1be4b92de90a07b78315e7ba3a9189b718cff2d0d43e47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / im_swagger_spy-0.4.0-py3-none-any.whl
| Download URL | im_swagger_spy-0.4.0-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a20dd5c606e0e7930b9aeabb30055d4c2730fec614d4b1e60c1de3c43cba6a7e
|
|
BLAKE2b-256 checksum How to use checksums |
cea9f3c1d9ab64d623164d28a8e4dbaf98a8c3b2367f3514bf0a5fcd33cb0d23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Security for im-swagger-spy 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.