summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml7
-rwxr-xr-xmimeparse.py2
-rwxr-xr-xmimeparse_test.py11
-rw-r--r--tox.ini8
4 files changed, 21 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml
index 7d3901c..cb5b1e1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,9 +6,16 @@ python:
env:
- TOXENV=py27
- TOXENV=py32
+ - TOXENV=py34
- TOXENV=pypy
- TOXENV=pep8,pyflakes
+# https://github.com/travis-ci/travis-ci/issues/4794
+matrix:
+ include:
+ - python: 3.5
+ env: TOXENV=py35
+
# command to install dependencies
install:
- pip install tox
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)
diff --git a/tox.ini b/tox.ini
index 72cd14a..38fb075 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,9 +1,15 @@
[tox]
-envlist = py32,py27,pypy,pep8,pyflakes
+envlist = py35,py34,py32,py27,pypy,pep8,pyflakes
[testenv]
commands = ./mimeparse_test.py
+[testenv:py35]
+basepython = python3.5
+
+[testenv:py34]
+basepython = python3.4
+
[testenv:py32]
basepython = python3.2