Exemplo n.º 1
0
    def json_from_response(self,
                           response: werkzeug.Response) -> dict[str, Any]:
        """Parses the json returned in a response."""

        data_text = response.get_data(as_text=True)
        self.assertEqual(200, response.status_code, msg=data_text)
        return typing.cast(dict[str, Any], json.loads(data_text))