From 26adb0015e104819866df7d0239c1182e63fa4ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriele=20H=C3=B6fler?= Date: Mon, 8 Jul 2019 16:40:05 +0200 Subject: [PATCH] Add tests for almasru, fix imports all tests --- marc_tools/tests/test_marc_extractor.py | 2 +- sru/tests/error.xml | 9 +++++++++ sru/tests/test_almasru.py | 12 ++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 sru/tests/error.xml create mode 100644 sru/tests/test_almasru.py diff --git a/marc_tools/tests/test_marc_extractor.py b/marc_tools/tests/test_marc_extractor.py index 20a2c49..700ab58 100644 --- a/marc_tools/tests/test_marc_extractor.py +++ b/marc_tools/tests/test_marc_extractor.py @@ -1,5 +1,5 @@ import pytest -import marc_extractor +import marc_tools.marc_extractor as marc_extractor class TestConstructSingleCommand: diff --git a/sru/tests/error.xml b/sru/tests/error.xml new file mode 100644 index 0000000..b86a99a --- /dev/null +++ b/sru/tests/error.xml @@ -0,0 +1,9 @@ + + 1.2 + + + 200801 + Catalog search has encountered an error + + + \ No newline at end of file diff --git a/sru/tests/test_almasru.py b/sru/tests/test_almasru.py new file mode 100644 index 0000000..63b7dd9 --- /dev/null +++ b/sru/tests/test_almasru.py @@ -0,0 +1,12 @@ +import pytest +import sru.almasru as almasru + +retriever = almasru.RecordRetriever('obv-at-oenb', '43ACC_ONB', 'marcxml') + + +class TestRecordRetriever: + + def test_erroneous_xml(self): + with pytest.raises(almasru.SruException): + retriever.by_mms_id('MMS-ID') + -- GitLab