Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(test): make integration test ingest-xmlupload #843

Merged
merged 8 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Iterator

import pytest
import regex

from dsp_tools.commands.ingest_xmlupload.upload_xml import ingest_xmlupload
from dsp_tools.models.exceptions import InputError
Expand All @@ -18,7 +19,7 @@ def _retrieve_mapping_file() -> Iterator[None]:


def test_ingest_xmlupload() -> None:
expected_msg = (
expected_msg = regex.escape(
"The upload cannot continue as there are problems with the multimedia files referenced in the XML.\n"
" The data XML file does not reference the following multimedia files "
"which were previously uploaded through dsp-ingest:\n"
Expand All @@ -38,7 +39,8 @@ def test_ingest_xmlupload() -> None:


def test_ingest_xmlupload_no_mapping() -> None:
with pytest.raises(InputError):
expected_msg = regex.escape("No mapping CSV file was found at mapping-00A5.csv.")
with pytest.raises(InputError, match=expected_msg):
ingest_xmlupload(
xml_file=Path("testdata/dsp-ingest-data/dsp_ingest_no_mapping.xml"),
user="root@example.com",
Expand Down