Esempio n. 1
0
def test_end_patron_session(app, dummy_client, end_patron_session_message):
    """Test invenio-sip2 patron enable action."""
    # IMPORTANT NOTE:
    # this test needs to be run last, because during this test,
    # the patron session is deleted
    response = current_sip2.sip2.execute(
        Message(request=end_patron_session_message), client=dummy_client)
    assert str(response).startswith('36')
 def execute(self, message, client):
     """Execute action."""
     last_response_message = client.last_response_message
     return Message(request=last_response_message.get('_sip2'))
Esempio n. 3
0
def test_selfcheck_login_success(users, selckeck_login_message):
    """Test selfcheck login."""
    response = current_sip2.sip2.execute(
        Message(request=selckeck_login_message), client=None)
    assert (response == '941')
Esempio n. 4
0
def test_checkin(app, dummy_client, checkin_message):
    """Test invenio-sip2 checkin action."""
    response = current_sip2.sip2.execute(Message(request=checkin_message),
                                         client=dummy_client)
    assert str(response).startswith('10')
Esempio n. 5
0
def test_item_information(app, dummy_client, item_information_message):
    """Test invenio-sip2 patron enable action."""
    response = current_sip2.sip2.execute(
        Message(request=item_information_message), client=dummy_client)
    assert str(response).startswith('18')
Esempio n. 6
0
def test_patron_status(app, dummy_client, patron_status_message):
    """Test invenio-sip2 patron enable action."""
    response = current_sip2.sip2.execute(
        Message(request=patron_status_message), client=dummy_client)
    assert str(response).startswith('24')
Esempio n. 7
0
def test_sip2_system_status(app, dummy_client, system_status_message):
    """Test invenio-sip2 system status action."""
    response = current_sip2.sip2.execute(
        Message(request=system_status_message), client=dummy_client)
    assert str(response).startswith('98')
Esempio n. 8
0
def test_sip2_login(app, dummy_client, login_message):
    """Test invenio-sip2 login action."""
    response = current_sip2.sip2.execute(Message(request=login_message),
                                         client=dummy_client)
    assert str(response) == '941'
Esempio n. 9
0
def test_renew(app, dummy_client, renew_message):
    """Test invenio-sip2 renew action."""
    response = current_sip2.sip2.execute(Message(request=renew_message),
                                         client=dummy_client)
    assert str(response).startswith('30')
Esempio n. 10
0
def test_hold(app, dummy_client, create_hold_message):
    """Test invenio-sip2 hold action."""
    response = current_sip2.sip2.execute(Message(request=create_hold_message),
                                         client=dummy_client)
    assert str(response).startswith('16')