Example #1
0
    def test_get_all_articles_notXML_not_xml(self, mk_get_articles):

        copy_SAMPLES_ARTICLE = deepcopy(SAMPLES_ARTICLE)
        copy_SAMPLES_ARTICLE["version"] = "xml"

        mk_get_articles.return_value = [Article(copy_SAMPLES_ARTICLE)]
        result = article.get_all_articles_notXML("0036-3634")
        self.assertEqual(result, [])
Example #2
0
    def test_get_all_articles_notXML(self, mk_ext_identifiers):

        obj_journal = Journal(SAMPLES_JOURNAL)
        mk_ext_identifiers.return_value = {
            "objects": [
                {"code": "S0036-36341997000100001"},
                {"code": "S2237-96222017000400783"},
            ]
        }
        result = article.get_all_articles_notXML("0036-3634")
        self.assertEqual(result[0][0], "S0036-36341997000100001")
Example #3
0
def extrated_journal_data(obj_journal):

    logger.info("\t coletando dados do periodico '%s'", obj_journal.title)
    list_articles = article.get_all_articles_notXML(obj_journal.scielo_issn)
    for name_article, xml_article in list_articles:

        logger.info("\t Salvando arquivo '%s'", name_article)
        files.write_file(
            os.path.join(config.get("SOURCE_PATH"), "%s.xml" % name_article),
            xml_article,
        )
    logger.info("\t Total de %s artigos", len(list_articles))
Example #4
0
    def test_get_all_articles_notXML(self, mk_get_articles):

        mk_get_articles.return_value = [Article(SAMPLES_ARTICLE)]
        result = article.get_all_articles_notXML("0036-3634")
        self.assertEqual(result[0][0], "S0036-36341997000100001")