Ejemplo n.º 1
0
class ProcessorTest( TestCase ):
    """ Tests models.Processor() """

    def setUp( self ):
        self.slr_data = SolrData()
        self.processor = Processor()

    def test_massage_data__author_title_A( self ):
        """ Checks parse of solr response. """
        dct_resp = self.slr_data.author_title_response_A
        self.assertEqual(
            [{u'author': u'Mu\xf1oz, Jos\xe9 Esteban',
              u'bib': u'b7779467',
              u'language': [u'English'],
              u'pub_date': [u'2009'],
              u'title': u'Cruising utopia the then and there of queer futurity',
              u'url': u'https://login.revproxy.brown.edu/login?url=http://site.ebrary.com/lib/brown/Doc?id=10425196'}],
            self.processor.massage_data( verbosity='full', raw_data_dct=dct_resp )
            )

    def test_massage_data__author_title_B( self ):
        """ Checks parse of solr response. """
        dct_resp = self.slr_data.author_title_response_B
        self.assertEqual(
            [{u'author': u'Bald, Vivek',
              u'bib': u'b7119857',
              u'language': [u'English'],
              u'pub_date': [u'2013'],
              u'title': u'Bengali Harlem and the lost histories of South Asian America',
              u'url': u'https://login.revproxy.brown.edu/login?url=http://site.ebrary.com/lib/brown/Doc?id=10642232'},
             {u'author': u'Bald, Vivek',
              u'bib': u'b7154298',
              u'language': [u'English'],
              u'pub_date': [u'2012'],
              u'title': u'Bengali Harlem and the lost histories of South Asian America',
              u'url': u'https://login.revproxy.brown.edu/login?url=http://search.ebscohost.com/login.aspx?direct=true&scope=site&db=e000xna&AN=502790'}],
            self.processor.massage_data( verbosity='full', raw_data_dct=dct_resp )
            )
Ejemplo n.º 2
0
 def setUp( self ):
     self.slr_data = SolrData()
     self.processor = Processor()