Skip to main content

No project description provided

Project description

vedro-jj

Codecov PyPI PyPI - Downloads Python Version

Vedro + jj

Installation

Quick

For a quick installation, you can use a plugin manager as follows:

$ vedro plugin install vedro-jj

Manual

To install manually, follow these steps:

  1. Install the package using pip:
$ pip3 install vedro-jj
  1. Next, activate the plugin in your vedro.cfg.py configuration file:
# ./vedro.cfg.py
import vedro
import vedro_jj

class Config(vedro.Config):

    class Plugins(vedro.Config.Plugins):

        class VedroJJ(vedro_jj.VedroJJ):
            enabled = True

Usage

import httpx
import jj
import vedro
from jj.mock import mocked

class Scenario(vedro.Scenario):
    subject = "get users"

    def given(self):
        self.mock_matcher = jj.match("GET", "/users")
        self.mock_response = jj.Response(json=[])

    def when(self):
        with mocked(self.mock_matcher, self.mock_response):
            self.response = httpx.get("http://localhost:8080/users")

    def then(self):
        assert self.response.status_code == 200
        assert self.response.json() == []
$ vedro run -vv

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

vedro-jj-0.2.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

vedro_jj-0.2.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file vedro-jj-0.2.0.tar.gz.

File metadata

  • Download URL: vedro-jj-0.2.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for vedro-jj-0.2.0.tar.gz
Algorithm Hash digest
SHA256 171a48d60ef4ded52ef9683022cd99b1c6f1d94c8d3a19e6e45df3392d478169
MD5 b2cb59f1438b37ebd20a35c919f14dd5
BLAKE2b-256 c81c21624283a040021e22041bf0f5141cc8e0ee744ae1922f68700779a850dd

See more details on using hashes here.

File details

Details for the file vedro_jj-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: vedro_jj-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for vedro_jj-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e20c92333bf373657c310dfddfaa2e2c56d905e77a557252a037f4fa5acb72e5
MD5 902476a8c93c0d972f1d92f268ba6f1d
BLAKE2b-256 9bf6612ac8754c35215f8271245b904ee11e4f147014bf5ca5da291d9faf02c9

See more details on using hashes here.

Supported by

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