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 -*-
Precision luminosity measurements at LHCb,
J. Instrum. 9 (2014) P12005
704 authors
* 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,
def record():
return load_record('', 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
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