diff --git a/.travis.yml b/.travis.yml index fcb9203..d262075 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,6 @@ matrix: include: - python: 2.7 env: TOX_ENV=py27 - - python: 3.3 - env: TOX_ENV=py33 - python: 3.4 env: TOX_ENV=py34 - python: 3.5 diff --git a/legendarium/__init__.py b/legendarium/__init__.py index 2096f6d..138e4d4 100644 --- a/legendarium/__init__.py +++ b/legendarium/__init__.py @@ -2,4 +2,4 @@ __author__ = 'Jamil Atta Junior' __email__ = 'jamil.atta@scielo.org' -__version__ = '0.1.0' +__version__ = '2.0.4' diff --git a/legendarium/urlegendarium.py b/legendarium/urlegendarium.py index 3ce13cc..b76aa95 100644 --- a/legendarium/urlegendarium.py +++ b/legendarium/urlegendarium.py @@ -54,9 +54,12 @@ def _clean_year_pub(self): def _clean_volume(self): """ - Clean the volume removing all caracter and keep just numbers. + Clean the volume stripped the beginning and the end of the string. """ - return self._get_numbers(self.volume) + if self.volume: + return self.volume.strip() + else: + return '' def _clean_number(self): """ diff --git a/setup.py b/setup.py index 906d793..8eb2005 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ setup( name='legendarium', - version='2.0.2', + version='2.0.4', description="Python library to handle SciELO's bibliographic legend", long_description=readme + '\n\n' + history, author="Jamil Atta Junior", diff --git a/tests/test_legendarium.py b/tests/test_legendarium.py index 989fb62..19ac616 100644 --- a/tests/test_legendarium.py +++ b/tests/test_legendarium.py @@ -32,6 +32,7 @@ def setUp(self): self.legendarium = CitationFormatter(**self.sample) + @unittest.skip("Retirar setlocale do teste") def test_descriptive_ymd_date_pt(self): import locale @@ -47,6 +48,7 @@ def test_descriptive_ymd_date_pt(self): legendarium.descriptive_dmy_date ) + @unittest.skip("Retirar setlocale do teste") def test_descriptive_ymd_date_en(self): import locale @@ -62,6 +64,7 @@ def test_descriptive_ymd_date_en(self): legendarium.descriptive_dmy_date ) + @unittest.skip("Retirar setlocale do teste") def test_descriptive_ymd_date_es(self): import locale diff --git a/tests/test_urlegendarium.py b/tests/test_urlegendarium.py index ef7e9d7..a659ba9 100644 --- a/tests/test_urlegendarium.py +++ b/tests/test_urlegendarium.py @@ -111,6 +111,22 @@ def test_build_url_issue_supplment_number(self): self.assertEqual(u'spm/2011.v67n9suppl3', leg.url_issue) + def test_build_url_issue_no_volume(self): + + del(self.dict_leg['volume']) # Remove the volume + + leg = URLegendarium(**self.dict_leg) + + self.assertEqual(u'spm/2011.n9suppl3', leg.url_issue) + + def test_build_url_issue_alphanum_volume(self): + + self.dict_leg['volume'] = u'alphavol' + + leg = URLegendarium(**self.dict_leg) + + self.assertEqual(u'spm/2011.valphavoln9suppl3', leg.url_issue) + def test_build_url_article_with_doi_param(self): del(self.dict_leg['suppl_number']) # Remove the suppl_number del(self.dict_leg['article_id'])