<s> from totalimpact . providers import provider <EOL> from totalimpact . providers . provider import Provider , ProviderFactory <EOL> from totalimpact . providers . provider import ProviderError , ProviderTimeout , ProviderServerError , ProviderClientError <EOL> from totalimpact . providers . provider import ProviderHttpError , ProviderContentMalformedError , ProviderValidationFailedError <EOL> import os , unittest <EOL> import simplejson <EOL> from nose . tools import nottest , raises , assert_equals <EOL> from nose . plugins . skip import SkipTest <EOL> class DummyResponse ( object ) : <EOL> def __init__ ( self , status , content ) : <EOL> self . status_code = status <EOL> self . text = content <EOL> self . headers = { "<STR_LIT>" : "<STR_LIT>" } <EOL> self . url = "<STR_LIT>" <EOL> def get_member_items_html_success ( self , url , headers = None , timeout = None , error_conf = None , cache_enabled = True , allow_redirects = False ) : <EOL> f = open ( SAMPLE_EXTRACT_MEMBER_ITEMS_PAGE , "<STR_LIT:r>" ) <EOL> return DummyResponse ( <NUM_LIT:200> , f . read ( ) ) <EOL> def get_member_items_html_zero_items ( self , url , headers = None , timeout = None , error_conf = None , cache_enabled = True , allow_redirects = False ) : <EOL> f = open ( SAMPLE_EXTRACT_MEMBER_ITEMS_PAGE_ZERO_ITEMS , "<STR_LIT:r>" ) <EOL> return DummyResponse ( <NUM_LIT:200> , f . read ( ) ) <EOL> def get_aliases_html_success ( self , url , headers = None , timeout = None , error_conf = None , cache_enabled = True , allow_redirects = False ) : <EOL> f = open ( SAMPLE_EXTRACT_ALIASES_PAGE , "<STR_LIT:r>" ) <EOL> return DummyResponse ( <NUM_LIT:200> , f . read ( ) ) <EOL> def get_metrics_html_success ( self , url , headers = None , timeout = None , error_conf = None , cache_enabled = True , allow_redirects = False ) : <EOL> f = open ( SAMPLE_EXTRACT_METRICS_PAGE , "<STR_LIT:r>" ) <EOL> return DummyResponse ( <NUM_LIT:200> , f . read ( ) ) <EOL> def get_biblio_html_success ( self , url , headers = None , timeout = None , error_conf = None , cache_enabled = True , allow_redirects = False ) : <EOL> f = open ( SAMPLE_EXTRACT_BIBLIO_PAGE , "<STR_LIT:r>" ) <EOL> return DummyResponse ( <NUM_LIT:200> , f . read ( ) ) <EOL> def get_nonsense_xml ( self , url , headers = None , timeout = None , error_conf = None , cache_enabled = True , allow_redirects = False ) : <EOL> return DummyResponse ( <NUM_LIT:200> , '<STR_LIT>' ) <EOL> def get_nonsense_txt ( self , url , headers = None , timeout = None , error_conf = None , cache_enabled = True , allow_redirects = False ) : <EOL> return DummyResponse ( <NUM_LIT:200> , "<STR_LIT>" ) <EOL> def get_empty ( self , url , headers = None , timeout = None , error_conf = None , cache_enabled = True , allow_redirects = False ) : <EOL> return DummyResponse ( <NUM_LIT:200> , "<STR_LIT>" ) <EOL> def get_400 ( self , url , headers = None , timeout = None , error_conf = None , cache_enabled = True , allow_redirects = False ) : <EOL> return DummyResponse ( <NUM_LIT> , "<STR_LIT>" ) <EOL> def get_500 ( self , url , headers = None , timeout = None , error_conf = None , cache_enabled = True , allow_redirects = False ) : <EOL> return DummyResponse ( <NUM_LIT> , "<STR_LIT>" ) <EOL> class ProviderTestCase : <EOL> """<STR_LIT>""" <EOL> testitem_aliases = ( ) <EOL> testitem_metrics = ( ) <EOL> testitem_biblio = ( ) <EOL> def setUp ( self ) : <EOL> self . provider = ProviderFactory . get_provider ( self . provider_name ) <EOL> self . old_http_get = Provider . http_get <EOL> def tearDown ( self ) : <EOL> Provider . http_get = self . old_http_get <EOL> def test_0003_provider_interface ( self ) : <EOL> """<STR_LIT>""" <EOL> assert hasattr ( self . provider , "<STR_LIT>" ) <EOL> assert hasattr ( self . provider , "<STR_LIT>" ) <EOL> assert hasattr ( self . provider , "<STR_LIT>" ) <EOL> assert hasattr ( self . provider , "<STR_LIT>" ) <EOL> assert hasattr ( self . provider , "<STR_LIT>" ) <EOL> assert hasattr ( self . provider , "<STR_LIT>" ) <EOL> assert hasattr ( self . provider , "<STR_LIT>" ) <EOL> assert hasattr ( self . provider , "<STR_LIT>" ) <EOL> assert hasattr ( self . provider , "<STR_LIT>" ) <EOL> assert hasattr ( self . provider , "<STR_LIT>" ) </s>
