Skip to main content

pytest plugin for mitmproxy tests

Project description

pytest_mitmproxy

install

pip install pytest-mitmproxy

install cert

mitm-install

usage

import pytest
import requests


def test_baidu(mitmdump_proxy):
    mitmdump_proxy.url_filter = "baidu"

    requests.get("http://www.baidu.com")

    url_list = mitmdump_proxy.get_urls()
    print(url_list)
    content_list = mitmdump_proxy.get_contents()
    print(content_list)
    assert "baidu" in "".join(url_list)


if __name__ == "__main__":
    pytest.main(["-vs"])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_mitmproxy-1.0.8.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_mitmproxy-1.0.8-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file pytest_mitmproxy-1.0.8.tar.gz.

File metadata

  • Download URL: pytest_mitmproxy-1.0.8.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.8

File hashes

Hashes for pytest_mitmproxy-1.0.8.tar.gz
Algorithm Hash digest
SHA256 4ecd3f763fce4dd275cd8f468d95cb763190dd29d0383bfa206e154b0c91c287
MD5 ada5e9102c16601e6e2eb8bf711c1fba
BLAKE2b-256 6a68f52886165bd375d323633596a6ee1e09f5a5003d923e961a60992f14c0fb

See more details on using hashes here.

File details

Details for the file pytest_mitmproxy-1.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_mitmproxy-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d07272913fff67c982830f532b126d6d0c38efbe38f646e3ba2d2c7a6abd252b
MD5 b2ea15ee27755167a9cc583da9d5ae12
BLAKE2b-256 a2118245b1550e3f95accd5b8ca8b946000f024358edbd6fe30a3c7d3c5c0a67

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page