diff options
Diffstat (limited to 'mimeparse_test.py')
-rwxr-xr-x | mimeparse_test.py | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/mimeparse_test.py b/mimeparse_test.py index 0ca36c8..6d00238 100755 --- a/mimeparse_test.py +++ b/mimeparse_test.py @@ -8,7 +8,6 @@ of PyUnitTestCases. Then it uses PyUnit to run them and report their status. import json import mimeparse import unittest -from functools import partial __version__ = "0.1" @@ -16,6 +15,7 @@ __author__ = 'Ade Oshineye' __email__ = "ade@oshineye.com" __credits__ = "" + class MimeParseTestCase(unittest.TestCase): def setUp(self): @@ -29,13 +29,11 @@ class MimeParseTestCase(unittest.TestCase): message = "Expected: '%s' but got %s" % (expected, result) self.assertEqual(expected, result, message) - def _test_quality(self, args, expected): result = mimeparse.quality(args[0], args[1]) message = "Expected: '%s' but got %s" % (expected, result) self.assertEqual(expected, result, message) - def _test_best_match(self, args, expected, description): if expected is None: self.assertRaises(mimeparse.MimeTypeParseException, mimeparse.best_match, args[0], args[1]) @@ -69,18 +67,6 @@ class MimeParseTestCase(unittest.TestCase): for args, expected in self.test_data['parse_mime_type']: self._test_parse_mime_type(args, expected) -def run_tests(): - json_object = json.load(open("testdata.json")) - - suite = unittest.TestSuite() - add_tests(suite, json_object, "parse_media_range", test_parse_media_range) - add_tests(suite, json_object, "quality", test_quality) - add_tests(suite, json_object, "best_match", test_best_match) - add_tests(suite, json_object, "parse_mime_type", test_parse_mime_type) - - test_runner = unittest.TextTestRunner(verbosity=1) - test_runner.run(suite) - if __name__ == '__main__': unittest.main() |