Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hepnames: support ids in 701__i and 701__w #70

Open
jacquerie opened this issue Aug 28, 2017 · 1 comment
Open

hepnames: support ids in 701__i and 701__w #70

jacquerie opened this issue Aug 28, 2017 · 1 comment

Comments

@jacquerie
Copy link
Contributor

See:

@pytest.mark.xfail(reason='identifiers in i and w are not handled')
def test_advisors_from_701__a_g_i():
schema = load_schema('authors')
subschema = schema['properties']['advisors']
snippet = (
'<datafield tag="701" ind1=" " ind2=" ">'
' <subfield code="a">Rivelles, Victor O.</subfield>'
' <subfield code="g">PhD</subfield>'
' <subfield code="i">INSPIRE-00120420</subfield>'
' <subfield code="x">991627</subfield>'
' <subfield code="y">1</subfield>'
'</datafield>'
) # record/1474091/export/xme
expected = [
{
'name': 'Rivelles, Victor O.',
'degree_type': 'PhD',
'ids': [
{
'schema': 'INSPIRE ID',
'value': 'INSPIRE-00120420'
}
],
'record': {
'$ref': 'http://localhost:5000/api/authors/991627',
},
'curated_relation': True
},
]
result = hepnames.do(create_record(snippet))
assert validate(result['advisors'], subschema) is None
assert expected == result['advisors']
expected = [
{
'a': 'Rivelles, Victor O.',
'g': 'PhD',
'i': 'INSPIRE-00120420',
},
]
result = hepnames2marc.do(result)
assert expected == result['701']

@jacquerie
Copy link
Contributor Author

Depends on inspirehep/inspire-schemas#182.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant