Commit a5508606 authored by Nicola Spanti's avatar Nicola Spanti
Browse files

[py] Make flake8 a bit less angry

parent c8b3f9dee096
......@@ -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
......
......@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment