Commit a79e38ca authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Remove tests for the obsolete module author_iterators.

parent 7318fcce
# -*- coding: utf-8 -*-
"""ARTICLE
http://cds.cern.ch/record/1951625.
Precision luminosity measurements at LHCb,
J. Instrum. 9 (2014) P12005
arXiv:1410.0149
704 authors
Note:
* The first author is not in the author list
* LHCb collaboration
* The publication year is a list (duplicate 773y)
* The submitted date is not formatted: 01 Oct 2014
"""
import itertools
import pytest
from invenio_tools import (iter_author_affiliations,
iter_author_affiliation_keys,
iter_author_fields,
iter_author_items,
iter_author_names,
load_record)
@pytest.fixture(scope="module")
def record():
return load_record('cds.cern.ch', 1951625)
def test_iter_affiliations(record):
assert type(iter_author_affiliations(record)) == itertools.imap
def test_iter_affiliation_keys(record):
assert type(iter_author_affiliation_keys(record)) == itertools.imap
def test_iter_author_fields(record):
assert type(iter_author_fields(record)) == itertools.chain
def test_iter_author_names(record):
assert type(iter_author_names(record)) == itertools.imap
def test_affiliations(record):
affiliations = list(iter_author_affiliations(record))
assert len(affiliations) == 704
assert affiliations[0] == ("NIKHEF, Amsterdam",)
assert affiliations[-8] == (u"Heidelberg, Max Planck Inst.", u"Lebedev Inst.")
def test_affiliation_keys(record):
keys = [tuple(el) for el in iter_author_affiliation_keys(record)]
assert len(keys) == 704
assert keys[0] == ("NIKHEF, Amsterdam",)
assert keys[-8] == (u"Heidelberg, Max Planck Inst.", u"Lebedev Inst.")
def test_items(record):
items = [(el[0], tuple(el[1])) for el in iter_author_items(record)]
import pprint
pprint.pprint(items)
assert len(items) == 704
assert items[0] == (u'Aaij, Roel', (u'NIKHEF, Amsterdam',))
assert items[-8] == (u'Zavertyaev, Mikhail', (u'Heidelberg, Max Planck Inst.', u'Lebedev Inst.'))
def test_names(record):
names = list(iter_author_names(record))
assert len(names) == 704
assert names[0] == "Aaij, Roel"
assert names[1] == "Adeva, Bernardo"
assert names[344] == "Le Gac, Renaud"
assert names[-1] == "Zvyagin, Alexander"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment