Skip to content
Snippets Groups Projects
Commit 072420db authored by gabriele-h's avatar gabriele-h
Browse files

More tests for almasru (multiple, unique, not_unique)

parent 6bcdb6f0
Branches
No related tags found
No related merge requests found
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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment