From 596fd9f9d1d9d1375cc928b173458cfc50023d41 Mon Sep 17 00:00:00 2001 From: Jamil Atta Junior Date: Fri, 23 Jun 2017 17:04:57 -0300 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7=C3=A3o=20the=20none=20type=20no=20s?= =?UTF-8?q?trip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- legendarium/legendarium.py | 5 ++++- legendarium/urlegendarium.py | 5 ++++- tests/test_legendarium.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/legendarium/legendarium.py b/legendarium/legendarium.py index b0e9387..f7fc797 100644 --- a/legendarium/legendarium.py +++ b/legendarium/legendarium.py @@ -73,7 +73,10 @@ def _clean_suppl_number(self): """ Clean the suppl_number stripped the beginning and the end of the string. """ - return self.suppl_number.strip() + if self.suppl_number: + return self.suppl_number.strip() + else: + return '' def get_journal(self): """ diff --git a/legendarium/urlegendarium.py b/legendarium/urlegendarium.py index 82f4f44..3726039 100644 --- a/legendarium/urlegendarium.py +++ b/legendarium/urlegendarium.py @@ -73,7 +73,10 @@ def _clean_suppl_number(self): """ Clean the supplement number stripped the beginning and the end of the string. """ - return self.suppl_number.strip() + if self.suppl_number: + return self.suppl_number.strip() + else: + return '' def get_journal_seg(self): """ diff --git a/tests/test_legendarium.py b/tests/test_legendarium.py index d80e463..a134a66 100644 --- a/tests/test_legendarium.py +++ b/tests/test_legendarium.py @@ -78,7 +78,7 @@ def test_build_legend_without_volume_and_number_and_year_pub_and_suppl_number(se self.assertEqual(u'Rev.Mal-Estar Subj:e00120416', leg.stamp) - def test_build_legend_without_volume_and_number_and_year_pub_(self): + def test_build_legend_without_volume_and_number_and_year_pub(self): del(self.dict_leg['volume']) # Remove the volume del(self.dict_leg['number']) # Remove the number