From 434f608e1e5ae750398305d68e26710bc2ae5bba Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Thu, 12 Dec 2024 16:10:51 -0300 Subject: [PATCH 01/17] =?UTF-8?q?Adiciona=20fun=C3=A7=C3=A3o=20'code'=20e?= =?UTF-8?q?=20respectivo=20teste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packtools/sps/formats/am/__init__.py | 0 packtools/sps/formats/am/am.py | 9 +++++++++ tests/sps/formats/am/test_am.py | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 packtools/sps/formats/am/__init__.py create mode 100644 packtools/sps/formats/am/am.py create mode 100644 tests/sps/formats/am/test_am.py diff --git a/packtools/sps/formats/am/__init__.py b/packtools/sps/formats/am/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/packtools/sps/formats/am/am.py b/packtools/sps/formats/am/am.py new file mode 100644 index 000000000..f88616448 --- /dev/null +++ b/packtools/sps/formats/am/am.py @@ -0,0 +1,9 @@ +import datetime + +from packtools.sps.models.article_ids import ArticleIds + + +def code(xml_tree, am_dict): + article_id_v2 = ArticleIds(xml_tree).v2 + am_dict.update({"code": article_id_v2}) + return am_dict diff --git a/tests/sps/formats/am/test_am.py b/tests/sps/formats/am/test_am.py new file mode 100644 index 000000000..24e8157b3 --- /dev/null +++ b/tests/sps/formats/am/test_am.py @@ -0,0 +1,19 @@ +from unittest import TestCase + +from packtools.sps.utils import xml_utils +from packtools.sps.formats.am import am +from packtools.sps.models.article_citations import ArticleCitations + + +class AM(TestCase): + def setUp(self): + self.xml_tree = xml_utils.get_xml_tree( + "tests/sps/fixtures/standard_scielo_xml/S0080-62342022000100445_JATS.xml" + ) + self.citation_data = list(ArticleCitations(self.xml_tree).article_citations)[0] + + def test_code(self): + self.assertDictEqual( + {"code": "S0080-62342022000100445"}, am.code(self.xml_tree, dict()) + ) + From bb2762702de30be8ccfddc60d538446754bb1ebb Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Thu, 12 Dec 2024 16:11:49 -0300 Subject: [PATCH 02/17] Adiciona assinatura de 'collection' --- packtools/sps/formats/am/am.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packtools/sps/formats/am/am.py b/packtools/sps/formats/am/am.py index f88616448..186b2611e 100644 --- a/packtools/sps/formats/am/am.py +++ b/packtools/sps/formats/am/am.py @@ -7,3 +7,10 @@ def code(xml_tree, am_dict): article_id_v2 = ArticleIds(xml_tree).v2 am_dict.update({"code": article_id_v2}) return am_dict + + +def collection(xml_tree, am_dict): + # TODO: adicionar a lógica de obtenção do código da coleção + return am_dict + + From ae76e3122b1e24326992e23aee2c72cb4ee04cec Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Thu, 12 Dec 2024 16:12:36 -0300 Subject: [PATCH 03/17] =?UTF-8?q?Adiciona=20fun=C3=A7=C3=A3o=20'processing?= =?UTF-8?q?=5Fdate'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packtools/sps/formats/am/am.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packtools/sps/formats/am/am.py b/packtools/sps/formats/am/am.py index 186b2611e..ac74b5c75 100644 --- a/packtools/sps/formats/am/am.py +++ b/packtools/sps/formats/am/am.py @@ -14,3 +14,14 @@ def collection(xml_tree, am_dict): return am_dict +def processing_date(xml_tree, am_dict): + date = ( + datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.%f")[ + :-3 + ] + + "Z" + ) + am_dict.update({"processing_date": date}) + return am_dict + + From 3e7e86239ec9b9acb200509f9a13849e31de9bb3 Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Thu, 12 Dec 2024 16:13:10 -0300 Subject: [PATCH 04/17] =?UTF-8?q?Adiciona=20fun=C3=A7=C3=A3o=20'citation?= =?UTF-8?q?=5Fid'=20e=20o=20respectivo=20teste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packtools/sps/formats/am/am.py | 6 ++++++ tests/sps/formats/am/test_am.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/packtools/sps/formats/am/am.py b/packtools/sps/formats/am/am.py index ac74b5c75..3f485d3f4 100644 --- a/packtools/sps/formats/am/am.py +++ b/packtools/sps/formats/am/am.py @@ -25,3 +25,9 @@ def processing_date(xml_tree, am_dict): return am_dict +def _citation_id(citation_data, citation_dict): + citation_id = citation_data.get("ref_id") + citation_dict.update({"v700": [{"_": citation_id}]}) + return citation_dict + + diff --git a/tests/sps/formats/am/test_am.py b/tests/sps/formats/am/test_am.py index 24e8157b3..7c2f270c1 100644 --- a/tests/sps/formats/am/test_am.py +++ b/tests/sps/formats/am/test_am.py @@ -17,3 +17,8 @@ def test_code(self): {"code": "S0080-62342022000100445"}, am.code(self.xml_tree, dict()) ) + def test_citation_id(self): + self.assertDictEqual( + {"v700": [{"_": "B1"}]}, am._citation_id(self.citation_data, dict()) + ) + From 7840618659040496f617ab81450a0079acd87c48 Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Thu, 12 Dec 2024 16:13:50 -0300 Subject: [PATCH 05/17] Adiciona assinatura de 'citation_code' --- packtools/sps/formats/am/am.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packtools/sps/formats/am/am.py b/packtools/sps/formats/am/am.py index 3f485d3f4..848f90475 100644 --- a/packtools/sps/formats/am/am.py +++ b/packtools/sps/formats/am/am.py @@ -31,3 +31,8 @@ def _citation_id(citation_data, citation_dict): return citation_dict +def _citation_code(citation_data, citation_dict): + # TODO: adicionar a lógica de obtenção do código da citação, eg.: "code": "S1519-6984202400010016500001" + return citation_dict + + From e55c818ccf09e76b88ddcef3a51b8fb3bbee902a Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Thu, 12 Dec 2024 16:14:46 -0300 Subject: [PATCH 06/17] =?UTF-8?q?Adiciona=20fun=C3=A7=C3=A3o=20'=5Fcitatio?= =?UTF-8?q?n=5Fdate'=20e=20o=20respectivo=20teste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packtools/sps/formats/am/am.py | 6 ++++++ tests/sps/formats/am/test_am.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/packtools/sps/formats/am/am.py b/packtools/sps/formats/am/am.py index 848f90475..1ea3fa536 100644 --- a/packtools/sps/formats/am/am.py +++ b/packtools/sps/formats/am/am.py @@ -36,3 +36,9 @@ def _citation_code(citation_data, citation_dict): return citation_dict +def _citation_date(citation_data, citation_dict): + citation_date = citation_data.get("year") + "0000" + citation_dict.update({"v865": [{"_": citation_date}]}) + return citation_dict + + diff --git a/tests/sps/formats/am/test_am.py b/tests/sps/formats/am/test_am.py index 7c2f270c1..5efa95cf6 100644 --- a/tests/sps/formats/am/test_am.py +++ b/tests/sps/formats/am/test_am.py @@ -22,3 +22,8 @@ def test_citation_id(self): {"v700": [{"_": "B1"}]}, am._citation_id(self.citation_data, dict()) ) + def test_citation_date(self): + self.assertDictEqual( + {"v865": [{"_": "20150000"}]}, am._citation_date(self.citation_data, dict()) + ) + From b113f0e2c4c7b313c01e18fb245603921caaebb9 Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Thu, 12 Dec 2024 16:15:48 -0300 Subject: [PATCH 07/17] =?UTF-8?q?Adiciona=20fun=C3=A7=C3=A3o=20'=5Fcitatio?= =?UTF-8?q?n=5Ftitle'=20e=20o=20respectivo=20teste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packtools/sps/formats/am/am.py | 7 +++++++ tests/sps/formats/am/test_am.py | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/packtools/sps/formats/am/am.py b/packtools/sps/formats/am/am.py index 1ea3fa536..756a46596 100644 --- a/packtools/sps/formats/am/am.py +++ b/packtools/sps/formats/am/am.py @@ -42,3 +42,10 @@ def _citation_date(citation_data, citation_dict): return citation_dict +def _citation_title(citation_data, citation_dict): + # TODO: adicionar a lógica de obtenção do idioma da citação + citation_title = citation_data.get("article_title") + citation_dict.update({"v12": [{"_": citation_title}]}) + return citation_dict + + diff --git a/tests/sps/formats/am/test_am.py b/tests/sps/formats/am/test_am.py index 5efa95cf6..bc3fbe713 100644 --- a/tests/sps/formats/am/test_am.py +++ b/tests/sps/formats/am/test_am.py @@ -27,3 +27,15 @@ def test_citation_date(self): {"v865": [{"_": "20150000"}]}, am._citation_date(self.citation_data, dict()) ) + def test_citation_title(self): + self.assertDictEqual( + { + "v12": [ + { + "_": "Smoking and potentially preventable hospitalisation: the benefit of smoking cessation in older ages" + } + ] + }, + am._citation_title(self.citation_data, dict()), + ) + From d38eccbf3de48c41226b078eff8c7b851d565e06 Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Thu, 12 Dec 2024 16:16:34 -0300 Subject: [PATCH 08/17] =?UTF-8?q?Adiciona=20fun=C3=A7=C3=A3o=20'citation?= =?UTF-8?q?=5Fvolume'=20e=20o=20respectivo=20teste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packtools/sps/formats/am/am.py | 6 ++++++ tests/sps/formats/am/test_am.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/packtools/sps/formats/am/am.py b/packtools/sps/formats/am/am.py index 756a46596..57715b0eb 100644 --- a/packtools/sps/formats/am/am.py +++ b/packtools/sps/formats/am/am.py @@ -49,3 +49,9 @@ def _citation_title(citation_data, citation_dict): return citation_dict +def _citation_volume(citation_data, citation_dict): + citation_volume = citation_data.get("volume") + citation_dict.update({"v31": [{"_": citation_volume}]}) + return citation_dict + + diff --git a/tests/sps/formats/am/test_am.py b/tests/sps/formats/am/test_am.py index bc3fbe713..df9fe8ac2 100644 --- a/tests/sps/formats/am/test_am.py +++ b/tests/sps/formats/am/test_am.py @@ -39,3 +39,8 @@ def test_citation_title(self): am._citation_title(self.citation_data, dict()), ) + def test_citation_volume(self): + self.assertDictEqual( + {"v31": [{"_": "150"}]}, am._citation_volume(self.citation_data, dict()) + ) + From 8642cc610d6d378ee71672e6459ee1f1e6392e93 Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Thu, 12 Dec 2024 16:18:06 -0300 Subject: [PATCH 09/17] =?UTF-8?q?Adiciona=20fun=C3=A7=C3=A3o=20'=5Fliterat?= =?UTF-8?q?ure=5Ftype'=20e=20o=20respectivo=20teste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packtools/sps/formats/am/am.py | 28 ++++++++++++++++++++++++++++ tests/sps/formats/am/test_am.py | 4 ++++ 2 files changed, 32 insertions(+) diff --git a/packtools/sps/formats/am/am.py b/packtools/sps/formats/am/am.py index 57715b0eb..78920bad1 100644 --- a/packtools/sps/formats/am/am.py +++ b/packtools/sps/formats/am/am.py @@ -55,3 +55,31 @@ def _citation_volume(citation_data, citation_dict): return citation_dict +def _translate_publication_type_to_literature_type(publication_type): + """ + Translates a publication type from the SciELO XML standard to the v705 classification. + + Args: + publication_type (str): The 'publication-type' value from SciELO XML. + + Returns: + str: The corresponding v705 classification. Defaults to 'D' (Document of work) if the type is not recognized. + """ + publication_type_to_v705 = { + "journal": "S", # Serial (journals, periodicals) + "book": "M", # Monograph (books) + "chapter": "C", # Component (book chapters) + "conference": "A", # Analytical (conference proceedings) + "thesis": "M", # Monograph (theses and dissertations) + "report": "M", # Monograph (technical reports) + "web": "G", # Collection (digital material) + "other": "D", # Document of work (undefined or others) + } + return publication_type_to_v705.get(publication_type, "D") + + +def _literature_type(citation_data, citation_dict): + citation_type = citation_data.get("publication_type") + literature_type = _translate_publication_type_to_literature_type(citation_type) + citation_dict.update({"v705": [{"_": literature_type}]}) + return citation_dict diff --git a/tests/sps/formats/am/test_am.py b/tests/sps/formats/am/test_am.py index df9fe8ac2..37c215495 100644 --- a/tests/sps/formats/am/test_am.py +++ b/tests/sps/formats/am/test_am.py @@ -44,3 +44,7 @@ def test_citation_volume(self): {"v31": [{"_": "150"}]}, am._citation_volume(self.citation_data, dict()) ) + def test_citation_literature_type(self): + self.assertDictEqual( + {"v705": [{"_": "S"}]}, am._literature_type(self.citation_data, dict()) + ) From f18223cf16a37ea401c830a06207ee8add8c1b6a Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Thu, 12 Dec 2024 16:18:40 -0300 Subject: [PATCH 10/17] Adiciona '__init__.py' --- tests/sps/formats/am/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/sps/formats/am/__init__.py diff --git a/tests/sps/formats/am/__init__.py b/tests/sps/formats/am/__init__.py new file mode 100644 index 000000000..e69de29bb From d446b3fa56f3b4a8451cc96d87aa821257be3a1a Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Fri, 13 Dec 2024 14:25:14 -0300 Subject: [PATCH 11/17] Adiciona 'citation_page_info' e os respectivos testes --- packtools/sps/formats/am/am.py | 11 +++++++++++ tests/sps/formats/am/test_am.py | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/packtools/sps/formats/am/am.py b/packtools/sps/formats/am/am.py index 78920bad1..160a15bda 100644 --- a/packtools/sps/formats/am/am.py +++ b/packtools/sps/formats/am/am.py @@ -83,3 +83,14 @@ def _literature_type(citation_data, citation_dict): literature_type = _translate_publication_type_to_literature_type(citation_type) citation_dict.update({"v705": [{"_": literature_type}]}) return citation_dict + +def _citation_page_info(citation_data, citation_dict): + lpage = citation_data.get("lpage") or "" + fpage = citation_data.get("fpage") or "" + try: + range_page = str(int(lpage) - int(fpage)) + except ValueError: + range_page = "" + elocation = citation_data.get("elocation_id") or "" + citation_dict.update({"v514": [{"_": "", "l": lpage, "f": fpage, "r": range_page, "e": elocation}]}) + return citation_dict diff --git a/tests/sps/formats/am/test_am.py b/tests/sps/formats/am/test_am.py index 37c215495..1f4c388e0 100644 --- a/tests/sps/formats/am/test_am.py +++ b/tests/sps/formats/am/test_am.py @@ -48,3 +48,9 @@ def test_citation_literature_type(self): self.assertDictEqual( {"v705": [{"_": "S"}]}, am._literature_type(self.citation_data, dict()) ) + + def test_citation_page_info(self): + self.assertDictEqual( + {"v514": [{"_": "", "l": "91", "f": "85", "r": "6", "e": ""}]}, + am._citation_page_info(self.citation_data, dict()) + ) From 8e53d0b809c7949e8e686921a156134ae10e40a8 Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Sun, 15 Dec 2024 22:41:14 -0300 Subject: [PATCH 12/17] =?UTF-8?q?Renomeia=20para=20padriniza=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packtools/sps/formats/am/am.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packtools/sps/formats/am/am.py b/packtools/sps/formats/am/am.py index 160a15bda..3fe190861 100644 --- a/packtools/sps/formats/am/am.py +++ b/packtools/sps/formats/am/am.py @@ -78,7 +78,7 @@ def _translate_publication_type_to_literature_type(publication_type): return publication_type_to_v705.get(publication_type, "D") -def _literature_type(citation_data, citation_dict): +def _citation_literature_type(citation_data, citation_dict): citation_type = citation_data.get("publication_type") literature_type = _translate_publication_type_to_literature_type(citation_type) citation_dict.update({"v705": [{"_": literature_type}]}) From 8a97c3fb1728168158ff3a80a7e238def76283c2 Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Sun, 15 Dec 2024 22:42:47 -0300 Subject: [PATCH 13/17] Adiciona 'citation_authors' e o respectivo teste --- packtools/sps/formats/am/am.py | 17 +++++++++++++++++ tests/sps/formats/am/test_am.py | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/packtools/sps/formats/am/am.py b/packtools/sps/formats/am/am.py index 3fe190861..b39ae250e 100644 --- a/packtools/sps/formats/am/am.py +++ b/packtools/sps/formats/am/am.py @@ -84,6 +84,7 @@ def _citation_literature_type(citation_data, citation_dict): citation_dict.update({"v705": [{"_": literature_type}]}) return citation_dict + def _citation_page_info(citation_data, citation_dict): lpage = citation_data.get("lpage") or "" fpage = citation_data.get("fpage") or "" @@ -94,3 +95,19 @@ def _citation_page_info(citation_data, citation_dict): elocation = citation_data.get("elocation_id") or "" citation_dict.update({"v514": [{"_": "", "l": lpage, "f": fpage, "r": range_page, "e": elocation}]}) return citation_dict + + +def _citation_author(author_data): + # TODO adicionar a lógica de obtenção de "role" ("r") + return {"n": author_data.get("given-names"), "r": "ND", "s": author_data.get("surname"), "_": ""} + + +def _citation_authors(citation_data, citation_dict): + authors = [] + for author_data in citation_data.get("all_authors"): + author_dict = _citation_author(author_data) + authors.append(author_dict) + citation_dict.update({"v10": authors}) + return citation_dict + + diff --git a/tests/sps/formats/am/test_am.py b/tests/sps/formats/am/test_am.py index 1f4c388e0..36d4297b5 100644 --- a/tests/sps/formats/am/test_am.py +++ b/tests/sps/formats/am/test_am.py @@ -54,3 +54,19 @@ def test_citation_page_info(self): {"v514": [{"_": "", "l": "91", "f": "85", "r": "6", "e": ""}]}, am._citation_page_info(self.citation_data, dict()) ) + + def test_citation_authors(self): + self.maxDiff = None + self.assertDictEqual( + { + "v10": [ + {'_': '', 'n': 'B', 'r': 'ND', 's': 'Tran'}, + {'_': '', 'n': 'MO', 'r': 'ND', 's': 'Falster'}, + {'_': '', 'n': 'K', 'r': 'ND', 's': 'Douglas'}, + {'_': '', 'n': 'F', 'r': 'ND', 's': 'Blyth'}, + {'_': '', 'n': 'LR', 'r': 'ND', 's': 'Jorm'} + ] + }, + am._citation_authors(self.citation_data, dict()) + ) + From 2f64ffc7ea6ba986bdf6fbf88664600970ed46d1 Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Sun, 15 Dec 2024 22:43:44 -0300 Subject: [PATCH 14/17] Adiciona 'citation_institutional_authors' e o respectivo teste --- packtools/sps/formats/am/am.py | 12 ++++++++++++ tests/sps/formats/am/test_am.py | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/packtools/sps/formats/am/am.py b/packtools/sps/formats/am/am.py index b39ae250e..d09dabb0c 100644 --- a/packtools/sps/formats/am/am.py +++ b/packtools/sps/formats/am/am.py @@ -111,3 +111,15 @@ def _citation_authors(citation_data, citation_dict): return citation_dict +def _citation_institutional_author(author_data): + return {"_": author_data.get("collab")} + +def _citation_institutional_authors(citation_data, citation_dict): + institutional_authors = [] + for institutional_author_data in citation_data.get("all_authors"): + institutional_author_dict = _citation_institutional_author(institutional_author_data) + institutional_authors.append(institutional_author_dict) + citation_dict.update({"v17": institutional_authors}) + return citation_dict + + diff --git a/tests/sps/formats/am/test_am.py b/tests/sps/formats/am/test_am.py index 36d4297b5..9240440e5 100644 --- a/tests/sps/formats/am/test_am.py +++ b/tests/sps/formats/am/test_am.py @@ -70,3 +70,13 @@ def test_citation_authors(self): am._citation_authors(self.citation_data, dict()) ) + def test_institutional_authors(self): + self.assertDictEqual( + { + "v17": [ + {'_': ['Instituto Nacional de Câncer José Alencar Gomes da Silva']} + ] + }, + am._citation_institutional_authors(self.citation_data_collab, dict()) + ) + From fb01119f29b2b897d1ebc92cf3afc62a82f0bc8c Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Sun, 15 Dec 2024 22:44:29 -0300 Subject: [PATCH 15/17] Adiciona 'citetion_publication_type' e o respectivo teste --- packtools/sps/formats/am/am.py | 5 +++++ tests/sps/formats/am/test_am.py | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/packtools/sps/formats/am/am.py b/packtools/sps/formats/am/am.py index d09dabb0c..0182a088a 100644 --- a/packtools/sps/formats/am/am.py +++ b/packtools/sps/formats/am/am.py @@ -123,3 +123,8 @@ def _citation_institutional_authors(citation_data, citation_dict): return citation_dict +def _citation_publication_type(citation_data, citation_dict): + citation_type = citation_data.get("publication_type") + citation_dict.update({"v71": [{"_": citation_type}],}) + return citation_dict + diff --git a/tests/sps/formats/am/test_am.py b/tests/sps/formats/am/test_am.py index 9240440e5..448f7c86c 100644 --- a/tests/sps/formats/am/test_am.py +++ b/tests/sps/formats/am/test_am.py @@ -80,3 +80,10 @@ def test_institutional_authors(self): am._citation_institutional_authors(self.citation_data_collab, dict()) ) + def test_citation_type(self): + self.assertDictEqual( + {"v71": [{"_": "journal"}]}, + am._citation_publication_type(self.citation_data, dict()) + ) + + From 0c334d3400f89294be4628c2d839182b86eb1da8 Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Sun, 15 Dec 2024 22:45:01 -0300 Subject: [PATCH 16/17] Adiciona exemplo de teste para 'collab' --- tests/sps/formats/am/test_am.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sps/formats/am/test_am.py b/tests/sps/formats/am/test_am.py index 448f7c86c..3d46b8ea9 100644 --- a/tests/sps/formats/am/test_am.py +++ b/tests/sps/formats/am/test_am.py @@ -11,6 +11,7 @@ def setUp(self): "tests/sps/fixtures/standard_scielo_xml/S0080-62342022000100445_JATS.xml" ) self.citation_data = list(ArticleCitations(self.xml_tree).article_citations)[0] + self.citation_data_collab = list(ArticleCitations(self.xml_tree).article_citations)[26] def test_code(self): self.assertDictEqual( From dd09eddf9865ebaf37e2e0879703e04ee7ad0800 Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Sun, 15 Dec 2024 22:45:25 -0300 Subject: [PATCH 17/17] =?UTF-8?q?Atualiza=20nome=20da=20fun=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/sps/formats/am/test_am.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sps/formats/am/test_am.py b/tests/sps/formats/am/test_am.py index 3d46b8ea9..046b0aa31 100644 --- a/tests/sps/formats/am/test_am.py +++ b/tests/sps/formats/am/test_am.py @@ -47,7 +47,7 @@ def test_citation_volume(self): def test_citation_literature_type(self): self.assertDictEqual( - {"v705": [{"_": "S"}]}, am._literature_type(self.citation_data, dict()) + {"v705": [{"_": "S"}]}, am._citation_literature_type(self.citation_data, dict()) ) def test_citation_page_info(self):