Writes data to a JSON file specified by the filename. This method only runs if the create_response_files flag is True. :param filename: The filename for the JSON file to be created. :param data: The data to be written to the file.
(self, filename, data)
| 35 | raise ApiException(f"API at {self._api_url} is not running. Please check if the API is up and running.") |
| 36 | |
| 37 | def _write_json(self, filename, data): |
| 38 | """ |
| 39 | Writes data to a JSON file specified by the filename. This method only runs if the create_response_files flag is True. |
| 40 | |
| 41 | :param filename: The filename for the JSON file to be created. |
| 42 | :param data: The data to be written to the file. |
| 43 | """ |
| 44 | if self._create_response_files: |
| 45 | path = _create_filename(filename) |
| 46 | write_json_response(path, data) |
| 47 | print(f"View {filename} response at: ./{path}") |
| 48 | |
| 49 | def _make_api_url(self, path): |
| 50 | return f"{self._api_url}/{path}" |
no test coverage detected