Metadata-Version: 2.1
Name: jj-district42
Version: 1.2.2
Home-page: https://github.com/jj-mock/jj-district42
Author: Nikita Tsvetkov
Author-email: tsv1@fastmail.com
License: Apache-2.0
Project-URL: Docs, https://jj-mock.io/docs/integrations/d42
Project-URL: GitHub, https://github.com/jj-mock/jj-district42
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: d42<2.0,>=1.5
Requires-Dist: district42-exp-types<1.0,>=0.9
Requires-Dist: jj<3.0,>=2.3.1
Requires-Dist: niltype<1.0,>=0.3
Requires-Dist: th<1.0,>=0.3

# jj-district42

⚠️ This package has been renamed to [jj-d42](https://pypi.org/project/jj-d42/). The [jj-district42](https://pypi.org/project/jj-district42/) package on PyPI is no longer maintained. For updates and improvements, please use [jj-d42](https://pypi.org/project/jj-d42/) going forward.

[![PyPI](https://img.shields.io/pypi/v/jj-district42.svg?style=flat-square)](https://pypi.python.org/pypi/jj-district42/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/jj-district42?style=flat-square)](https://pypi.python.org/pypi/jj-district42/)
[![Python Version](https://img.shields.io/pypi/pyversions/jj-district42.svg?style=flat-square)](https://pypi.python.org/pypi/jj-district42/)


## Installation

```sh
pip3 install jj-district42
```

## Usage

```python
import jj
import httpx
from jj.mock import mocked
from jj_district42 import HistorySchema
from valera import validate_or_fail


matcher = jj.match("GET", "/users")
response = jj.Response(status=200, json=[])

with mocked(matcher, response) as mock:
    resp = httpx.get("http://localhost:8080/users", params={"user_id": 1})

assert validate_or_fail(
    HistorySchema % [
        {
            "request": {
                "method": "GET",
                "path": "/users",
                "params": {"user_id": "1"},
            }
        }
    ],
    mock.history
)
```
