예제 #1
0
def test_ebook_id_minter(base_app, db):
    """Test minter."""
    data = {
        'other_standard_identifier': [{
            'standard_number_or_code':
            'http://cantookstation.com/resources/55373535cdd23087a9789b72'
        }]
    }
    # first record
    rec_uuid = uuid4()
    ebook_pid_minter(rec_uuid, data, 'cantook')
    assert data.get('pid') == 'cantook-55373535cdd23087a9789b72'
예제 #2
0
def test_item_id_fetcher(base_app, db):
    """Test fetcher."""
    data = {
        'other_standard_identifier': [{
            'standard_number_or_code':
            'http://cantookstation.com/resources/55373535cdd23087a9789b72'
        }]
    }
    # first record
    rec_uuid = uuid4()
    ebook_pid_minter(rec_uuid, data, 'cantook')
    fetched_pid = ebook_pid_fetcher(rec_uuid, data)
    assert fetched_pid.pid_type == fetched_pid.provider.pid_type
    assert fetched_pid.pid_type == 'ebook'
    assert fetched_pid.pid_value == 'cantook-55373535cdd23087a9789b72'