diff options
-rw-r--r-- | __pkginfo__.py | 22 | ||||
-rw-r--r-- | setup.py | 8 | ||||
-rw-r--r-- | test/unittest_textutils.py | 22 |
3 files changed, 32 insertions, 20 deletions
diff --git a/__pkginfo__.py b/__pkginfo__.py index 9b0262e..855c74b 100644 --- a/__pkginfo__.py +++ b/__pkginfo__.py @@ -3,22 +3,26 @@ # # This file is part of logilab-common. # -# logilab-common is free software: you can redistribute it and/or modify it under -# the terms of the GNU Lesser General Public License as published by the Free -# Software Foundation, either version 2.1 of the License, or (at your option) any -# later version. +# logilab-common is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by the +# Free Software Foundation, either version 2.1 of the License, or (at your +# option) any later version. # # logilab-common is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # -# You should have received a copy of the GNU Lesser General Public License along -# with logilab-common. If not, see <http://www.gnu.org/licenses/>. +# You should have received a copy of the GNU Lesser General Public License +# along with logilab-common. If not, see <http://www.gnu.org/licenses/>. + """logilab.common packaging information""" + __docformat__ = "restructuredtext en" + import sys import os +from os.path import join distname = 'logilab-common' modname = 'common' @@ -28,15 +32,15 @@ subpackage_master = True numversion = (1, 4, 3) version = '.'.join([str(num) for num in numversion]) -license = 'LGPL' # 2.1 or later -description = "collection of low-level Python packages and modules used by Logilab projects" +license = 'LGPL' # 2.1 or later +description = ("collection of low-level Python packages and modules" + " used by Logilab projects") web = "http://www.logilab.org/project/%s" % distname mailinglist = "mailto://python-projects@lists.logilab.org" author = "Logilab" author_email = "contact@logilab.fr" -from os.path import join scripts = [join('bin', 'logilab-pytest')] include_dirs = [join('test', 'data')] @@ -5,10 +5,10 @@ # # This file is part of logilab-common. # -# logilab-common is free software: you can redistribute it and/or modify it under -# the terms of the GNU Lesser General Public License as published by the Free -# Software Foundation, either version 2.1 of the License, or (at your option) any -# later version. +# logilab-common is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by the +# Free Software Foundation, either version 2.1 of the License, or (at your +# option) any later version. # # logilab-common is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS diff --git a/test/unittest_textutils.py b/test/unittest_textutils.py index 2fa648a..3e9a343 100644 --- a/test/unittest_textutils.py +++ b/test/unittest_textutils.py @@ -104,6 +104,7 @@ aller discuter avec les autres si c'est utile ou necessaire.""") > .. _extrait: > http://www.editions-eni.fr/Livres/Python-Les-fondamentaux-du-langage---La-programmation-pour-les-scientifiques-Extrait-du-livre/.20_d6eed0be-0d36-4384-be59-2dd09e081012_0_0.pdf""") + class NormalizeParagraphTC(TestCase): def test_known_values(self): @@ -167,15 +168,15 @@ class UnitsTC(TestCase): def test_unit_singleunit_singleletter(self): result = tu.apply_units('15m', self.units) - self.assertEqual(result, 15 * self.units['m'] ) + self.assertEqual(result, 15 * self.units['m']) def test_unit_singleunit_multipleletter(self): result = tu.apply_units('47KB', self.units) - self.assertEqual(result, 47 * self.units['kb'] ) + self.assertEqual(result, 47 * self.units['kb']) def test_unit_singleunit_caseinsensitive(self): result = tu.apply_units('47kb', self.units) - self.assertEqual(result, 47 * self.units['kb'] ) + self.assertEqual(result, 47 * self.units['kb']) def test_unit_multipleunit(self): result = tu.apply_units('47KB 1.5MB', self.units) @@ -186,15 +187,22 @@ class UnitsTC(TestCase): self.assertEqual(result, 1000 * self.units['kb']) def test_unit_wrong_input(self): - self.assertRaises(ValueError, tu.apply_units, '', self.units) - self.assertRaises(ValueError, tu.apply_units, 'wrong input', self.units) - self.assertRaises(ValueError, tu.apply_units, 'wrong13 input', self.units) - self.assertRaises(ValueError, tu.apply_units, 'wrong input42', self.units) + self.assertRaises( + ValueError, tu.apply_units, '', self.units) + self.assertRaises( + ValueError, tu.apply_units, 'wrong input', self.units) + self.assertRaises( + ValueError, tu.apply_units, 'wrong13 input', self.units) + self.assertRaises( + ValueError, tu.apply_units, 'wrong input42', self.units) with self.assertRaises(ValueError) as cm: tu.apply_units('42 cakes', self.units) self.assertIn('invalid unit cakes.', str(cm.exception)) + RGX = re.compile('abcd') + + class PrettyMatchTC(TestCase): def test_known(self): |