Mockallan

Latest version: v0.1.0

Safety actively analyzes 624552 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.1.0

Assertion API Changes

- Replace API paths `/call-args`, `/call-args-list` and `/call-count` with `/request-body`, `/request-body-list` and `/request-count`.

Stub Configuration JSON File Format Changes

- Replace field `code` with `status_code` in stub configuration JSON. Also replace attribute `code` with `status_code` in class `Response`.

Fixes

- Validate method name when loading configuration JSON. E.g. `TypeError: 'post': unsupported method`
- Added new 400 status responses for `PUT /config` in case of invalid configuration object.

json
{
"status": 400,
"type": "json-decode-error",
"title": "Error decoding JSON object",
"detail": "JSONDecodeError: Expecting value: line 1 column 1 (char 0)."
}
{
"status": 400,
"type": "missing-property-error",
"title": "Missing required property",
"detail": "'defaults': missing required property."
}
{
"status": 400,
"type": "unexpected-property-error",
"title": "Unexpected property",
"detail": "TypeError: 'code' must be <class 'int'> but it is actually <class 'str'>."
}


Other

- Update `stub_config.json` demo file.

0.0.7

Fixes
- Handle `BrokenPipeError` while reading or writing the socket.

0.0.6

Fixes
- Fix handle PUT/POST without body properly. Now PUT/POST without body returns status 400, type `bad-request`.

0.0.5

Fixes
- GET /call-args
- GET /call-args-list

0.0.3

**Features**

- Regular expression support in assertions. Custom header `X-Mockallan-Validator: regex` is used to select regex validation.

**Fixes**

- Fix GET /call-count

**Refactors**

- Validation refactored out to validator classes: IsEqualValidator, JSONSchemaValidator and RegexValidator to decouple it from History and make it easier to add validators.

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.