From 2c86c2dc7a0d6ccad5cb04d467c3c62a3968b299 Mon Sep 17 00:00:00 2001 From: fatiherikli Date: Sun, 21 Apr 2013 10:47:48 +0300 Subject: [PATCH 1/3] Fixed wrong named class --- test/test_server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_server.py b/test/test_server.py index 15d01fc0f..87a0d7c66 100644 --- a/test/test_server.py +++ b/test/test_server.py @@ -119,7 +119,7 @@ class TestRocketServer(TestServer): class TestFapwsServer(TestServer): server = 'fapws3' -class TestFapwsServer(TestServer): +class MeinheldServer(TestServer): server = 'meinheld' class TestBjoernServer(TestServer): From 59e2d55413445709d39b3c6473918ca61a8ab33f Mon Sep 17 00:00:00 2001 From: fatiherikli Date: Sun, 21 Apr 2013 10:52:24 +0300 Subject: [PATCH 2/3] Fixed some pep8 warnings --- test/test_router.py | 5 +++-- test/test_securecookies.py | 1 + test/testall.py | 10 +++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/test/test_router.py b/test/test_router.py index b433985ad..8a731233d 100755 --- a/test/test_router.py +++ b/test/test_router.py @@ -1,8 +1,9 @@ import unittest import bottle + class TestRouter(unittest.TestCase): - CGI=False + CGI = False def setUp(self): self.r = bottle.Router() @@ -130,5 +131,5 @@ class TestRouterInCGIMode(TestRouter): CGI = True -if __name__ == '__main__': #pragma: no cover +if __name__ == '__main__': # pragma: no cover unittest.main() diff --git a/test/test_securecookies.py b/test/test_securecookies.py index 4305aa71f..b439c27b0 100644 --- a/test/test_securecookies.py +++ b/test/test_securecookies.py @@ -1,5 +1,6 @@ #coding: utf-8 import unittest + import bottle from bottle import tob, touni diff --git a/test/testall.py b/test/testall.py index c1456298b..a3f85b0b7 100755 --- a/test/testall.py +++ b/test/testall.py @@ -22,7 +22,6 @@ ''') sys.exit(0) - if 'fast' in sys.argv: sys.stderr.write("Warning: The 'fast' keyword skipps server tests.\n") test_names.remove('test_server') @@ -30,13 +29,16 @@ cov = None if 'coverage' in sys.argv: import coverage + cov = coverage.coverage(data_suffix=True, branch=True) cov.start() suite = unittest.defaultTestLoader.loadTestsFromNames(test_names) + def run(): import bottle + bottle.debug(True) vlevel = 2 if 'verbose' in sys.argv else 0 result = unittest.TextTestRunner(verbosity=vlevel).run(suite) @@ -48,13 +50,15 @@ def run(): # recognized cnew = coverage.coverage(data_suffix=True, branch=True) cnew.combine() - cnew.report(morfs=['bottle.py']+test_files, show_missing=False) + cnew.report(morfs=['bottle.py'] + test_files, show_missing=False) if 'html' in sys.argv: print - cnew.html_report(morfs=['bottle.py']+test_files, directory='../build/coverage') + cnew.html_report(morfs=['bottle.py'] + test_files, + directory='../build/coverage') sys.exit((result.errors or result.failures) and 1 or 0) + if __name__ == '__main__': run() From ddce3a8914bc7abd52cbe67be771385eddbe8924 Mon Sep 17 00:00:00 2001 From: fatiherikli Date: Sun, 21 Apr 2013 10:54:29 +0300 Subject: [PATCH 3/3] Removed unused imports --- test/test_auth.py | 1 - test/test_environ.py | 5 ++--- test/test_mount.py | 2 +- test/test_plugins.py | 1 - test/test_resources.py | 2 -- test/test_sendfile.py | 3 +-- test/test_server.py | 1 - test/test_wsgi.py | 1 - test/tools.py | 3 --- 9 files changed, 4 insertions(+), 15 deletions(-) diff --git a/test/test_auth.py b/test/test_auth.py index 55b029689..e07ffb501 100644 --- a/test/test_auth.py +++ b/test/test_auth.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -import unittest import bottle from tools import ServerTestBase diff --git a/test/test_environ.py b/test/test_environ.py index f5e1a6906..4153e17ca 100755 --- a/test/test_environ.py +++ b/test/test_environ.py @@ -2,12 +2,11 @@ ''' Tests for the BaseRequest and BaseResponse objects and their subclasses. ''' import unittest -import sys, os.path +import sys import bottle -from bottle import request, response, tob, touni, tonat, json_dumps, _e, HTTPError +from bottle import request, tob, touni, tonat, json_dumps, _e, HTTPError import tools import wsgiref.util -import threading import base64 from bottle import BaseRequest, BaseResponse, LocalRequest diff --git a/test/test_mount.py b/test/test_mount.py index 11d8ef673..d268d42a9 100644 --- a/test/test_mount.py +++ b/test/test_mount.py @@ -1,6 +1,6 @@ import bottle from tools import ServerTestBase -from bottle import Bottle, response +from bottle import response class TestAppMounting(ServerTestBase): def setUp(self): diff --git a/test/test_plugins.py b/test/test_plugins.py index c6d190dba..2745f0efc 100644 --- a/test/test_plugins.py +++ b/test/test_plugins.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- import unittest -import bottle import tools diff --git a/test/test_resources.py b/test/test_resources.py index a6b753c81..8ccaeb775 100644 --- a/test/test_resources.py +++ b/test/test_resources.py @@ -1,5 +1,3 @@ -import bottle -from tools import ServerTestBase from bottle import ResourceManager import os.path import unittest diff --git a/test/test_sendfile.py b/test/test_sendfile.py index 502a4996d..620150cdb 100755 --- a/test/test_sendfile.py +++ b/test/test_sendfile.py @@ -1,8 +1,7 @@ import unittest -from bottle import static_file, HTTPError, HTTPResponse, request, response, parse_date, parse_range_header, Bottle, tob +from bottle import static_file, request, response, parse_date, parse_range_header, Bottle, tob import wsgiref.util import os -import os.path import tempfile import time diff --git a/test/test_server.py b/test/test_server.py index 87a0d7c66..c83612d5b 100644 --- a/test/test_server.py +++ b/test/test_server.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- import unittest -import bottle import time from tools import tob import sys diff --git a/test/test_wsgi.py b/test/test_wsgi.py index 4b9a944b5..91efa9061 100755 --- a/test/test_wsgi.py +++ b/test/test_wsgi.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- import unittest -import sys, os.path import bottle from tools import ServerTestBase from bottle import tob diff --git a/test/tools.py b/test/tools.py index a52566b3c..a03ef808c 100755 --- a/test/tools.py +++ b/test/tools.py @@ -1,11 +1,8 @@ # -*- coding: utf-8 -*- import bottle -import threading import sys -import time import unittest import wsgiref -import wsgiref.simple_server import wsgiref.util import wsgiref.validate