

@pytest.mark.parametrize('doc', [Document({
    'dc': {
        'identifier': ['foobar'],
    },
}, claimant='http://example.com'), Document({
    'dc': {
        'identifier': ['doi:foobar'],
    },
}, claimant='http://example.com')])
def test_uris_generates_doi_uri_from_dc_meta(self, doc):
    expected = [DocumentURI({
        'claimant': 'http://example.com',
        'uri': 'doi:foobar',
        'type': 'dc-doi',
        'created': None,
        'updated': None,
    }), DocumentURI({
        'claimant': 'http://example.com',
        'uri': 'http://example.com',
        'type': 'self-claim',
        'created': None,
        'updated': None,
    })]
    assert (sorted(doc.document_uris) == sorted(expected))

dataset/ETHPy150Open hypothesis/h/h/api/models/test/elastic_test.py TestDocument.test_uris_generates_doi_uri_from_dc_meta/original