File: responses.py

package info (click to toggle)
python-openapi-core 0.22.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,104 kB
  • sloc: python: 19,979; makefile: 44
file content (21 lines) | stat: -rw-r--r-- 528 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""OpenAPI core testing responses module"""

from typing import Any
from typing import Dict
from typing import Optional

from werkzeug.datastructures import Headers


class MockResponse:
    def __init__(
        self,
        data: bytes,
        status_code: int = 200,
        headers: Optional[Dict[str, Any]] = None,
        content_type: str = "application/json",
    ):
        self.data = data
        self.status_code = status_code
        self.headers = Headers(headers or {})
        self.content_type = content_type