No project description provided
Project description
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:
- Install the package using pip:
$ pip3 install vedro-jj
- 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)