<s> from test . unit_tests . providers import common <EOL> from test . unit_tests . providers . common import ProviderTestCase <EOL> from totalimpact . providers . provider import Provider , ProviderContentMalformedError <EOL> from totalimpact . providers import provider <EOL> from test . utils import http <EOL> import os <EOL> import collections <EOL> from nose . tools import assert_equals , assert_items_equal , raises <EOL> datadir = os . path . join ( os . path . split ( __file__ ) [ <NUM_LIT:0> ] , "<STR_LIT>" ) <EOL> SAMPLE_EXTRACT_ALIASES_PAGE = os . path . join ( datadir , "<STR_LIT>" ) <EOL> SAMPLE_EXTRACT_MEMBER_ITEMS_PAGE = os . path . join ( datadir , "<STR_LIT>" ) <EOL> SAMPLE_EXTRACT_BIBLIO_PAGE = os . path . join ( datadir , "<STR_LIT>" ) <EOL> class TestArxiv ( ProviderTestCase ) : <EOL> provider_name = "<STR_LIT>" <EOL> testitem_members = "<STR_LIT>" <EOL> testitem_aliases = ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> testitem_biblio = ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> def setUp ( self ) : <EOL> ProviderTestCase . setUp ( self ) <EOL> def test_is_relevant_alias ( self ) : <EOL> assert_equals ( self . provider . is_relevant_alias ( self . testitem_aliases ) , True ) <EOL> assert_equals ( self . provider . is_relevant_alias ( ( "<STR_LIT>" , "<STR_LIT>" ) ) , False ) <EOL> def test_members ( self ) : <EOL> members = self . provider . member_items ( { "<STR_LIT>" : self . testitem_members } ) <EOL> print members <EOL> expected = [ ( '<STR_LIT>' , '<STR_LIT>' ) ] <EOL> assert_equals ( members , expected ) <EOL> def test_aliases ( self ) : <EOL> aliases = self . provider . aliases ( [ self . testitem_aliases ] ) <EOL> print aliases <EOL> expected = [ ( '<STR_LIT:url>' , '<STR_LIT>' ) ] <EOL> assert_equals ( aliases , expected ) <EOL> def test_extract_biblio ( self ) : <EOL> f = open ( SAMPLE_EXTRACT_BIBLIO_PAGE , "<STR_LIT:r>" ) <EOL> biblio = self . provider . _extract_biblio ( f . read ( ) , "<STR_LIT>" ) <EOL> expected = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:title>' : u'<STR_LIT>' , '<STR_LIT>' : u'<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : u'<STR_LIT>' , '<STR_LIT:date>' : u'<STR_LIT>' } <EOL> print biblio <EOL> assert_items_equal ( biblio , expected ) <EOL> @ http <EOL> def test_biblio ( self ) : <EOL> biblio_dict = self . provider . biblio ( [ self . testitem_biblio ] ) <EOL> print biblio_dict <EOL> expected = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:title>' : u'<STR_LIT>' , '<STR_LIT>' : u'<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : u'<STR_LIT>' , '<STR_LIT:date>' : u'<STR_LIT>' } <EOL> assert_items_equal ( biblio_dict . keys ( ) , expected . keys ( ) ) <EOL> def test_provider_member_items_400 ( self ) : <EOL> pass <EOL> def test_provider_member_items_500 ( self ) : <EOL> pass <EOL> def test_provider_member_items_empty ( self ) : <EOL> pass <EOL> def test_provider_member_items_nonsense_txt ( self ) : <EOL> pass <EOL> def test_provider_member_items_nonsense_xml ( self ) : <EOL> pass <EOL> def test_provider_aliases_400 ( self ) : <EOL> pass <EOL> def test_provider_aliases_500 ( self ) : <EOL> pass </s>
