Exemple #1
0
 def _run_solr_steps( self, initial_id ):
     """ Takes initial_id string.
             Runs through processing steps including running update_solr().
             Returns update_solr_dict.
         Called by test_update_solr(). """
     p = Processor()
     grab_dict = p.grab_original_xml( file_id=initial_id )
     munger_dict = p.run_munger( source_xml=grab_dict[u'xml'] )
     initial_doc_dict = p.make_initial_solr_doc( munger_dict[u'munged_xml'] )
     updated_disply_dict = p.update_display_facet( initial_solr_xml=initial_doc_dict[u'transformed_xml'], display_status=u'to_approve' )
     update_solr_dict = p.update_solr( updated_disply_dict[u'updated_xml'] )
     return update_solr_dict
Exemple #2
0
 def test_update_display_facet( self ):
     """ Tests for well-formed xml and type of returned string.
         TODO: update to check for _valid_ xml once I have access to a schema. """
     p = Processor()
     grab_dict = p.grab_original_xml( file_id=u'beth0282' )
     munger_dict = p.run_munger( source_xml=grab_dict[u'xml'] )
     initial_doc_dict = p.make_initial_solr_doc( munger_dict[u'munged_xml'] )
     updated_disply_dict = p.update_display_facet( initial_solr_xml=initial_doc_dict[u'transformed_xml'], display_status=u'to_approve' )
     ## type check
     self.assertEqual(
         unicode,
         type(updated_disply_dict[u'updated_xml']) )
     ## well-formedness check
     well_formedness_dict = common.check_xml_wellformedness( xml=updated_disply_dict[u'updated_xml'] )
     self.assertEqual(
         True,
         well_formedness_dict[u'well_formed'] )