Exemplo n.º 1
0
    def test_replace_titles(self):

        # Covers deletion of obsolete titles, insertion of new titles, and modification of existing records
        updating_loader = DataLoader( self.db, self.test_classifications, overwrite=True )

        updating_loader.load_biblio( 'data/biblio_typical.json' )
        self.verify_titles( 1, {'DE':u"VERWENDUNG EINES LATENTREAKTIVEN KLEBEFILMS ZUR VERKLEBUNG VON ELOXIERTEM ALUMINIUM MIT KUNSTSTOFF", 
                                'FR':u"UTILISATION D'UN FILM ADHÉSIF À RÉACTIVITÉ LATENTE POUR LE COLLAGE DE PLASTIQUE SUR DE L'ALUMINIUM ANODISÉ",     
                                'EN':u"USE OF A LATENTLY REACTIVE ADHESIVE FILM FOR ADHESIVE BONDING OF ELOXATED ALUMINIUM TO PLASTIC" } )

        updating_loader.load_biblio( 'data/biblio_typical_update.json' )

        self.verify_titles( 1, {'DE':u"Dis ist der neu titlen", 
                                'ZH':u"寻设备息的传消呼方法和输" } )
Exemplo n.º 2
0
    def test_replace_document(self):
        simple_loader = DataLoader( self.db, self.test_classifications, overwrite=True )
        simple_loader.load_biblio( 'data/biblio_typical.json' )

        rows = self.query_all(['schembl_document']).fetchall()
        self.failUnlessEqual( 25, len(rows) )
        self.check_doc_row( rows[0], (1,'WO-2013127697-A1',date(2013,9,6),0,47747634) )
        self.check_doc_row( rows[18], (19,'WO-2013189302-A1',date(2013,12,27),0,49768126) )

        simple_loader.load_biblio( 'data/biblio_typical_update.json' )

        rows = self.query_all(['schembl_document']).fetchall()
        self.failUnlessEqual( 25, len(rows) )
        self.check_doc_row( rows[0], (1,'WO-2013127697-A1',date(2013,9,5),0,47474747) )
        self.check_doc_row( rows[18], (19,'WO-2013189302-A1',date(2013,12,31),1,47474748) ) # This record is now life-sci-relevant
Exemplo n.º 3
0
    def test_replace_classes(self):

        # Covers deletion of obsolete classes, insertion of new classes, and modification of existing records
        updating_loader = DataLoader( self.db, self.test_classifications, overwrite=True )

        updating_loader.load_biblio( 'data/biblio_typical.json' )

        self.verify_classes( 19, DocumentClass.IPC,  [])
        self.verify_classes( 19, DocumentClass.ECLA, [])
        self.verify_classes( 19, DocumentClass.IPCR, ["H04W 68/02"])
        self.verify_classes( 19, DocumentClass.CPC,  ["H04W 68/005"])

        updating_loader.load_biblio( 'data/biblio_typical_update.json' )

        self.verify_classes( 19, DocumentClass.IPC,  ["TEST_CLASS1"])                 # Doc now has one IPC class (insertion - life sci relevant)
        self.verify_classes( 19, DocumentClass.ECLA, ["H04W 76/02"])                  # Doc now has one ECLA class (insertion)
        self.verify_classes( 19, DocumentClass.IPCR, ["B32B 37/12","H04W 68/02"])     # Doc now has one extra IPCR (1 unchanged, 1 insert)
        self.verify_classes( 19, DocumentClass.CPC,  [])                              # Doc now has zero CPC classes (deletion)
Exemplo n.º 4
0
    def test_chems_loaded_for_existing_docs(self):
        extra_loader = DataLoader( self.db, self.test_classifications )
        extra_loader.load_biblio( 'data/biblio_typical.json' )
        self.load(['data/biblio_typical.json', 'data/chem_single_row_alternative.tsv'])

        self.verify_chem_mappings([ (15,7676,88,77,66,55,44,33) ])
Exemplo n.º 5
0
 def test_disable_classifications(self):
     simple_loader = DataLoader( self.db, self.test_classifications, load_classifications=False )
     simple_loader.load_biblio( 'data/biblio_typical.json' )
     rows = self.query_all(['schembl_document_class']).fetchall()
     self.failUnlessEqual(0, len(rows))