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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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