diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2016-01-05 16:05:32 +0200 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2016-01-05 16:24:48 +0200 |
commit | bead79690b6f2786313fb2e4f0f1cd2cde2cad07 (patch) | |
tree | 8296e269e81e6a1d3b30df91c00e3295a8a3a878 | |
parent | 76155e28992395293abc70244f05a6f77f955cb0 (diff) | |
download | python-mimeparse-bead79690b6f2786313fb2e4f0f1cd2cde2cad07.tar.gz |
pep8 fixes
-rwxr-xr-x | mimeparse.py | 2 | ||||
-rwxr-xr-x | mimeparse_test.py | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/mimeparse.py b/mimeparse.py index e258016..9f2788e 100755 --- a/mimeparse.py +++ b/mimeparse.py @@ -65,7 +65,7 @@ def parse_media_range(range): necessary. """ (type, subtype, params) = parse_mime_type(range) - if not 'q' in params or not params['q'] or \ + if 'q' not in params or not params['q'] or \ float(params['q']) > 1 or float(params['q']) < 0: params['q'] = '1' diff --git a/mimeparse_test.py b/mimeparse_test.py index ce639e4..d179982 100755 --- a/mimeparse_test.py +++ b/mimeparse_test.py @@ -5,17 +5,18 @@ Python tests for Mime-Type Parser. This module loads a json file and converts the tests specified therein to a set of PyUnitTestCases. Then it uses PyUnit to run them and report their status. """ -__version__ = "0.1" -__author__ = 'Ade Oshineye' -__email__ = "ade@oshineye.com" -__credits__ = "" - import json import mimeparse import unittest from functools import partial +__version__ = "0.1" +__author__ = 'Ade Oshineye' +__email__ = "ade@oshineye.com" +__credits__ = "" + + def test_parse_media_range(args, expected): expected = tuple(expected) result = mimeparse.parse_media_range(args) |