#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `ScopusSearch` module."""

from nose.tools import assert_equal

import scopus


s = scopus.ScopusSearch('AU-ID(24320488600)', refresh=True)


def test_EIDS():
    assert_equal(s.EIDS, ['2-s2.0-26444452434'])


def test_org_summary():
    expected = '1. [[https://www.scopus.com/inward/record.uri?partnerID=\
HzOxMe3b&scp=26444452434&origin=inward][2-s2.0-26444452434]]  Mario Draghi, \
Economists as policymakers: A round-table discussion. Introduction, European \
Economic Review, 36(2-3), p. 307-309, (1992). https://doi.org/None, \
https://www.scopus.com/inward/record.uri?partnerID=HzOxMe3b&scp=26444452434&\
origin=inward, cited 1 times (Scopus).\n  Affiliations:\n   \n'
    assert_equal(s.org_summary, expected)

@@ -79,16 +79,51 @@
 le.%22%22%22%0A%0A
+from collections import namedtuple%0A
 from nos
@@ -238,20 +238,24 @@
 ef test_
-EIDS
+get_eids
 ():%0A    
@@ -273,12 +273,18 @@
 l(s.
-EIDS
+get_eids()
 , %5B'
@@ -320,465 +320,856 @@
 est_
-org_summary():%0A    expected = '1. %5B%5Bhttps://www.scopus.com/inward/record.uri?partnerID=%5C%0AHzOxMe3b&scp=26444452434&origin=inward%5D%5B2-s2.0-26444452434%5D%5D  Mario Draghi, %5C%0AEconomists as policymakers: A round-table discussion. Introduction, European %5C%0AEconomic Review, 36(2-3), p. 307-309, (1992). https://doi.org/None, %5C%0Ahttps://www.scopus.com/inward/record.uri?partnerID=HzOxMe3b&scp=26444452434&%5C%0Aorigin=inward, cited 1 times (Scopus).%5Cn  Affiliations:%5Cn   %5Cn'
+results():%0A    order = 'eid doi pii title subtype creator authname authid coverDate '%5C%0A            'coverDisplayDate publicationName issn source_id aggregationType '%5C%0A            'volume issueIdentifier pageRange citedby_count openaccess'%0A    doc = namedtuple('Document', order)%0A    expected = doc(eid='2-s2.0-26444452434', doi='10.1016/0014-2921(92)90085-B',%0A        pii='001429219290085B', title='Economists as policymakers: A round-table discussion. Introduction',%0A        subtype='ar', creator='Draghi M.', authname='Draghi M.',%0A        authid='24320488600', coverDate='1992-01-01',%0A        coverDisplayDate='April 1992', publicationName='European Economic Review',%0A        issn='00142921', source_id='20749', aggregationType='Journal',%0A        volume='36', issueIdentifier='2-3', pageRange='307-309',%0A        citedby_count='1', openaccess='0')
 %0A   
@@ -1188,19 +1188,19 @@
 l(s.
-org_summary
+results%5B-1%5D
 , ex

Rewrite test for ScopusSearch