diff --git a/sru/tests/test_almasru.py b/sru/tests/test_almasru.py index 63b7dd9e56cc5c4cc677b3147926a71620bbd5c0..9fd155e20915c3749f421d59a1f40b469cf41868 100644 --- a/sru/tests/test_almasru.py +++ b/sru/tests/test_almasru.py @@ -1,12 +1,26 @@ import pytest import sru.almasru as almasru -retriever = almasru.RecordRetriever('obv-at-oenb', '43ACC_ONB', 'marcxml') +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') + RETRIEVER.by_mms_id('MMS-ID') + def test_get_multiple(self): + query = "alma.local_control_field_009=AC13320616 OR alma.local_control_field_009=AC13320328" + RETRIEVER.get_multiple(query) + assert True + + def test_get_unique(self): + query = "alma.local_control_field_009=AC13320616" + RETRIEVER.get_unique(query) + assert True + + def test_not_unique(self): + query = "alma.local_control_field_009=AC13320616 OR alma.local_control_field_009=AC13320328" + with pytest.raises(almasru.NotUnique): + RETRIEVER.get_unique(query)