diff --git a/tests/api_tests/test_api_format_archives.py b/tests/api_tests/test_api_format_archives.py index 63663149..1f7213f1 100644 --- a/tests/api_tests/test_api_format_archives.py +++ b/tests/api_tests/test_api_format_archives.py @@ -4,42 +4,43 @@ class TestApiArchiveReader(AbstractTestApiDocReader): + parameters = dict(with_attachments="True", need_content_analysis="True") def _get_abs_path(self, file_name: str) -> str: return os.path.join(self.data_directory_path, "archives", file_name) def _check_archive_with_english_doc(self, file_name: str) -> None: - result = self._send_request(file_name, dict(with_attachments="True")) + result = self._send_request(file_name, self.parameters) self.assertEqual(len(result["attachments"]), 4) english_doc = [doc for doc in result["attachments"] if doc["metadata"]["file_name"].startswith("english_doc")][0] self._check_english_doc(english_doc) def test_zip(self) -> None: file_name = "arch_with_attachs.zip" - result = self._send_request(file_name, dict(with_attachments="True")) + result = self._send_request(file_name, self.parameters) self.assertEqual(len(result["attachments"]), 4) def test_tar(self) -> None: file_name = "arch_with_attachs.tar" - result = self._send_request(file_name, dict(with_attachments="True")) + result = self._send_request(file_name, self.parameters) self.assertEqual(len(result["attachments"]), 4) def test_targz(self) -> None: file_name = "arch_with_attachs.tar.gz" - result = self._send_request(file_name, dict(with_attachments="True")) + result = self._send_request(file_name, self.parameters) self.assertEqual(len(result["attachments"]), 4) def test_rar(self) -> None: file_name = "arch_with_attachs.rar" - result = self._send_request(file_name, dict(with_attachments="True")) + result = self._send_request(file_name, self.parameters) self.assertEqual(len(result["attachments"]), 4) def test_7zip(self) -> None: file_name = "arch_with_attachs.7z" - result = self._send_request(file_name, dict(with_attachments="True")) + result = self._send_request(file_name, self.parameters) self.assertEqual(len(result["attachments"]), 4) @@ -65,7 +66,7 @@ def test_archive_subfolder_7z(self) -> None: def test_zip_with_unsupported_file(self) -> None: file_name = "arch_with_unsupport_atchs.zip" - result = self._send_request(file_name, dict(with_attachments="True")) + result = self._send_request(file_name, self.parameters) attachs = result["attachments"] self.assertEqual(len(attachs), 6) @@ -74,7 +75,7 @@ def test_zip_with_unsupported_file(self) -> None: def test_broken_archive(self) -> None: file_name = "broken.zip" - result = self._send_request(file_name, dict(with_attachments="True")) + result = self._send_request(file_name, self.parameters) self.assertEqual(len(result["attachments"]), 7) english_doc = [doc for doc in result["attachments"] if doc["metadata"]["file_name"].startswith("english_doc")][0] self._check_english_doc(english_doc)