def test_buildPubLists_live_data(self):
   pubs = Publications()
   pubs.getPubData()  # makes solr call
   pubs.buildPubLists()
   self.assertEqual( type(pubs.corpora), list )
   self.assertEqual( type(pubs.journals), list )
   self.assertEqual( type(pubs.monographs), list )
   id_list = pubs.master_pub_dict[u"A Generation of Antiquities: The Duke Classical Collection 1964-1994"]
   # pprint.pprint( id_list )
   self.assertEqual( len(id_list), 3 )
   # self.assertTrue( u'Corpus Inscriptionum Latinarum' in pubs.corpora )
   # self.assertTrue( u'American Journal of Philology' in pubs.journals )
   # self.assertTrue( u'Classical Attic Tombstones' in pubs.monographs )
   # self.assertEqual( pubs.corpora_dict[u'Corpus Inscriptionum Latinarum'][0], u'KY.Lou.SAM.L.1929.17.495' )
   # self.assertEqual( pubs.journals_dict[u'American Journal of Archaeology'][0], u'MI.AA.UM.KM.L.846' )
   # self.assertEqual( pubs.monographs_dict[u'Ancient Art from the V. G. Simkhovitch Collection'][0], u'IN.Bloom.IUAM.G.63.105.34' )
   # print u'pubs.monographs_dict...'; pprint.pprint( pubs.monographs_dict )
   # print u'pubs.monographs...'; pprint.pprint( pubs.monographs )
   self.assertTrue( len(pubs.master_pub_dict.keys()) > 150 )
Esempio n. 2
0
 def test_buildPubLists_live_data(self):
     pubs = Publications()
     pubs.getPubData()  # makes solr call
     pubs.buildPubLists()
     self.assertEqual(type(pubs.corpora), list)
     self.assertEqual(type(pubs.journals), list)
     self.assertEqual(type(pubs.monographs), list)
     id_list = pubs.master_pub_dict[
         u"A Generation of Antiquities: The Duke Classical Collection 1964-1994"]
     # pprint.pprint( id_list )
     self.assertEqual(len(id_list), 3)
     # self.assertTrue( u'Corpus Inscriptionum Latinarum' in pubs.corpora )
     # self.assertTrue( u'American Journal of Philology' in pubs.journals )
     # self.assertTrue( u'Classical Attic Tombstones' in pubs.monographs )
     # self.assertEqual( pubs.corpora_dict[u'Corpus Inscriptionum Latinarum'][0], u'KY.Lou.SAM.L.1929.17.495' )
     # self.assertEqual( pubs.journals_dict[u'American Journal of Archaeology'][0], u'MI.AA.UM.KM.L.846' )
     # self.assertEqual( pubs.monographs_dict[u'Ancient Art from the V. G. Simkhovitch Collection'][0], u'IN.Bloom.IUAM.G.63.105.34' )
     # print u'pubs.monographs_dict...'; pprint.pprint( pubs.monographs_dict )
     # print u'pubs.monographs...'; pprint.pprint( pubs.monographs )
     self.assertTrue(len(pubs.master_pub_dict.keys()) > 150)
Esempio n. 3
0
 def test_buildPubLists(self):
     data = [{
         u'bib_ids': [u'CAT_2', u'Rudolph'],
         u'bib_ids_types': [u'monograph'],
         u'bib_titles_all': [
             u'Classical Attic Tombstones',
             u'Ancient Art from the V. G. Simkhovitch Collection'
         ],
         u'id':
         u'IN.Bloom.IUAM.G.63.105.34'
     }, {
         u'bib_ids': [u'CIL_VI'],
         u'bib_ids_types': [u'corpora'],
         u'bib_titles_all': [u'Corpus Inscriptionum Latinarum'],
         u'id': u'KY.Lou.SAM.L.1929.17.495'
     }, {
         u'bib_ids': [u'CIL_VI'],
         u'bib_ids_types': [u'corpora'],
         u'bib_titles_all': [u'Corpus Inscriptionum Latinarum'],
         u'id': u'KY.Lou.SAM.L.1929.17.753'
     }, {
         u'bib_ids': [u'CIL_VI', u'HSCP_Moore'],
         u'bib_ids_types': [u'corpora', u'journal'],
         u'bib_titles_all': [
             u'Corpus Inscriptionum Latinarum',
             u'Harvard Studies in Classical Philology'
         ],
         u'id':
         u'MA.Camb.HU.Sack.L.1977.216.1954'
     }, {
         u'bib_ids': [u'AJP_Wilson5'],
         u'bib_ids_types': [u'journal'],
         u'bib_titles_all': [u'American Journal of Philology'],
         u'id': u'MD.Balt.JHU.L.99'
     }, {
         u'bib_ids': [u'CIL_X', u'Tuck'],
         u'bib_ids_types': [u'corpora', u'monograph'],
         u'bib_titles_all': [
             u'Corpus Inscriptionum Latinarum',
             u'Latin Inscriptions in the Kelsey Mueum: The Dennison and De Criscio Collections'
         ],
         u'id':
         u'MI.AA.UM.KM.L.1038'
     }, {
         u'bib_ids': [u'AJA_Dennison', u'ILS', u'Tuck'],
         u'bib_ids_types': [u'journal', u'corpora', u'monograph'],
         u'bib_titles_all': [
             u'American Journal of Archaeology',
             u'Incriptiones Latinae Selectae',
             u'Latin Inscriptions in the Kelsey Mueum: The Dennison and De Criscio Collections'
         ],
         u'id':
         u'MI.AA.UM.KM.L.846'
     }, {
         u'bib_ids': [u'CIL_XV'],
         u'bib_ids_types': [u'corpora'],
         u'bib_titles_all': [u'Corpus Inscriptionum Latinarum'],
         u'id': u'MO.Col.UM.MAA.L.83.263.4'
     }, {
         u'bib_ids': [u'CIL_XV'],
         u'bib_ids_types': [u'corpora'],
         u'bib_titles_all': [u'Corpus Inscriptionum Latinarum'],
         u'id': u'NY.NY.CU.Butl.L.164'
     }, {
         u'bib_ids': [u'Dentzer'],
         u'bib_ids_types': [u'monograph'],
         u'bib_titles_all': [
             u"Le motif du banquet couch\xe9 dans le Proche-Orient et le monde Grec du viie au ive si\xe8cle avant J.-C, Biblioth\xe8que des \xc9coles Francaises d'Ath\xe8nes et de Rome, vol. 246"
         ],
         u'id':
         u'NY.NY.MMA.G.57.42'
     }]
     assert type(data) == list
     assert type(data[0]) == dict
     pubs = Publications()
     pubs.pubs_entries = data
     pubs.buildPubLists()
     # print u'pubs.corpora...'; pprint.pprint( pubs.corpora )
     # print u'pubs.journals...'; pprint.pprint( pubs.journals )
     # print u'pubs.monographs...'; pprint.pprint( pubs.monographs )
     # print u'pubs.corpora_dict...'; pprint.pprint( pubs.corpora_dict )
     # print u'pubs.journals_dict...'; pprint.pprint( pubs.journals_dict )
     # print u'pubs.monographs_dict...'; pprint.pprint( pubs.monographs_dict )
     # print u'pubs.master_pub_dict...'; pprint.pprint( pubs.master_pub_dict )
     self.assertEqual(type(pubs.corpora), list)
     self.assertEqual(type(pubs.journals), list)
     self.assertEqual(type(pubs.monographs), list)
     self.assertTrue(u'Corpus Inscriptionum Latinarum' in pubs.corpora)
     self.assertTrue(u'American Journal of Philology' in pubs.journals)
     self.assertTrue(u'Classical Attic Tombstones' in pubs.monographs)
     self.assertEqual(
         pubs.corpora_dict[u'Corpus Inscriptionum Latinarum'][0],
         u'KY.Lou.SAM.L.1929.17.495')
     self.assertEqual(
         pubs.journals_dict[u'American Journal of Archaeology'][0],
         u'MI.AA.UM.KM.L.846')
     self.assertEqual(
         pubs.monographs_dict[
             u'Ancient Art from the V. G. Simkhovitch Collection'][0],
         u'IN.Bloom.IUAM.G.63.105.34')
     self.assertEqual(len(pubs.master_pub_dict.keys()), 9)
 def test_buildPubLists(self):
   data = [
    {u'bib_ids': [u'CAT_2', u'Rudolph'],
     u'bib_ids_types': [u'monograph'],
     u'bib_titles_all': [u'Classical Attic Tombstones',
                         u'Ancient Art from the V. G. Simkhovitch Collection'],
     u'id': u'IN.Bloom.IUAM.G.63.105.34'},
    {u'bib_ids': [u'CIL_VI'],
     u'bib_ids_types': [u'corpora'],
     u'bib_titles_all': [u'Corpus Inscriptionum Latinarum'],
     u'id': u'KY.Lou.SAM.L.1929.17.495'},
    {u'bib_ids': [u'CIL_VI'],
     u'bib_ids_types': [u'corpora'],
     u'bib_titles_all': [u'Corpus Inscriptionum Latinarum'],
     u'id': u'KY.Lou.SAM.L.1929.17.753'},
    {u'bib_ids': [u'CIL_VI', u'HSCP_Moore'],
     u'bib_ids_types': [u'corpora', u'journal'],
     u'bib_titles_all': [u'Corpus Inscriptionum Latinarum',
                         u'Harvard Studies in Classical Philology'],
     u'id': u'MA.Camb.HU.Sack.L.1977.216.1954'},
    {u'bib_ids': [u'AJP_Wilson5'],
     u'bib_ids_types': [u'journal'],
     u'bib_titles_all': [u'American Journal of Philology'],
     u'id': u'MD.Balt.JHU.L.99'},
    {u'bib_ids': [u'CIL_X', u'Tuck'],
     u'bib_ids_types': [u'corpora', u'monograph'],
     u'bib_titles_all': [u'Corpus Inscriptionum Latinarum',
                         u'Latin Inscriptions in the Kelsey Mueum: The Dennison and De Criscio Collections'],
     u'id': u'MI.AA.UM.KM.L.1038'},
    {u'bib_ids': [u'AJA_Dennison', u'ILS', u'Tuck'],
     u'bib_ids_types': [u'journal', u'corpora', u'monograph'],
     u'bib_titles_all': [u'American Journal of Archaeology',
                         u'Incriptiones Latinae Selectae',
                         u'Latin Inscriptions in the Kelsey Mueum: The Dennison and De Criscio Collections'],
     u'id': u'MI.AA.UM.KM.L.846'},
    {u'bib_ids': [u'CIL_XV'],
     u'bib_ids_types': [u'corpora'],
     u'bib_titles_all': [u'Corpus Inscriptionum Latinarum'],
     u'id': u'MO.Col.UM.MAA.L.83.263.4'},
    {u'bib_ids': [u'CIL_XV'],
     u'bib_ids_types': [u'corpora'],
     u'bib_titles_all': [u'Corpus Inscriptionum Latinarum'],
     u'id': u'NY.NY.CU.Butl.L.164'},
    {u'bib_ids': [u'Dentzer'],
     u'bib_ids_types': [u'monograph'],
     u'bib_titles_all': [u"Le motif du banquet couch\xe9 dans le Proche-Orient et le monde Grec du viie au ive si\xe8cle avant J.-C, Biblioth\xe8que des \xc9coles Francaises d'Ath\xe8nes et de Rome, vol. 246"],
     u'id': u'NY.NY.MMA.G.57.42'}]
   assert type(data) == list
   assert type(data[0]) == dict
   pubs = Publications()
   pubs.pubs_entries = data
   pubs.buildPubLists()
   # print u'pubs.corpora...'; pprint.pprint( pubs.corpora )
   # print u'pubs.journals...'; pprint.pprint( pubs.journals )
   # print u'pubs.monographs...'; pprint.pprint( pubs.monographs )
   # print u'pubs.corpora_dict...'; pprint.pprint( pubs.corpora_dict )
   # print u'pubs.journals_dict...'; pprint.pprint( pubs.journals_dict )
   # print u'pubs.monographs_dict...'; pprint.pprint( pubs.monographs_dict )
   # print u'pubs.master_pub_dict...'; pprint.pprint( pubs.master_pub_dict )
   self.assertEqual( type(pubs.corpora), list )
   self.assertEqual( type(pubs.journals), list )
   self.assertEqual( type(pubs.monographs), list )
   self.assertTrue( u'Corpus Inscriptionum Latinarum' in pubs.corpora )
   self.assertTrue( u'American Journal of Philology' in pubs.journals )
   self.assertTrue( u'Classical Attic Tombstones' in pubs.monographs )
   self.assertEqual( pubs.corpora_dict[u'Corpus Inscriptionum Latinarum'][0], u'KY.Lou.SAM.L.1929.17.495' )
   self.assertEqual( pubs.journals_dict[u'American Journal of Archaeology'][0], u'MI.AA.UM.KM.L.846' )
   self.assertEqual( pubs.monographs_dict[u'Ancient Art from the V. G. Simkhovitch Collection'][0], u'IN.Bloom.IUAM.G.63.105.34' )
   self.assertEqual( len(pubs.master_pub_dict.keys()), 9 )