예제 #1
0
    def pipeline_crossref(self):
        xylose_article = CustomArticle(self._article)

        ppl = plumber.Pipeline(
            export_crossref.SetupDoiBatchPipe(), export_crossref.XMLHeadPipe(),
            export_crossref.XMLBodyPipe(), export_crossref.XMLDoiBatchIDPipe(),
            export_crossref.XMLTimeStampPipe(),
            export_crossref.XMLDepositorPipe(),
            export_crossref.XMLRegistrantPipe(),
            export_crossref.XMLJournalPipe(),
            export_crossref.XMLJournalMetadataPipe(),
            export_crossref.XMLJournalTitlePipe(),
            export_crossref.XMLAbbreviatedJournalTitlePipe(),
            export_crossref.XMLISSNPipe(),
            export_crossref.XMLJournalIssuePipe(),
            export_crossref.XMLPubDatePipe(), export_crossref.XMLVolumePipe(),
            export_crossref.XMLIssuePipe(),
            export_crossref.XMLJournalArticlePipe(),
            export_crossref.XMLArticleTitlesPipe(),
            export_crossref.XMLArticleTitlePipe(),
            export_crossref.XMLArticleContributorsPipe(),
            export_crossref.XMLArticleAbstractPipe(),
            export_crossref.XMLArticlePubDatePipe(),
            export_crossref.XMLPagesPipe(), export_crossref.XMLPIDPipe(),
            export_crossref.XMLPermissionsPipe(),
            export_crossref.XMLElocationPipe(),
            export_crossref.XMLDOIDataPipe(), export_crossref.XMLDOIPipe(),
            export_crossref.XMLResourcePipe(),
            export_crossref.XMLCollectionPipe(),
            export_crossref.XMLArticleCitationsPipe(),
            export_crossref.XMLClosePipe())

        transformed_data = ppl.run(xylose_article, rewrap=True)

        return next(transformed_data)
    def test_time_stamp_element(self):

        xmlcrossref = ET.Element('doi_batch')

        xmlcrossref.append(ET.Element('head'))

        data = [self._article_meta, xmlcrossref]

        xmlcrossref = export_crossref.XMLTimeStampPipe()
        raw, xml = xmlcrossref.transform(data)

        self.assertEqual('timestamp', xml.find('head/timestamp').tag)