Skip to main content

No project description provided

Project description

vedro-jj

Vedro Interactive

Codecov PyPI PyPI - Downloads Python Version

Installation

1. Install package

$ pip3 install vedro-jj

2. Enable plugin

# ./vedro.cfg.py
import vedro
import vedro_jj

class Config(vedro.Config):

    class Plugins(vedro.Config.Plugins):

        class RemoteMock(vedro_jj.RemoteMock):
            enabled = True

Usage

# ./scenarios/get_users.py
import jj
import vedro
from httpx import AsyncClient
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=[])

    async def when(self):
        async with mocked(self.mock_matcher, self.mock_response):
            async with AsyncClient() as client:
                self.response = await client.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.0.1.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

vedro_jj-0.0.1-py3-none-any.whl (7.1 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