tsqa test cases: Pylint cleanup
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/70f46438 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/70f46438 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/70f46438 Branch: refs/heads/master Commit: 70f464387580b953c4a3f0df8bf266311a8e6515 Parents: 1e0ae28 Author: Thomas Jackson <[email protected]> Authored: Fri Aug 28 18:35:46 2015 -0700 Committer: Thomas Jackson <[email protected]> Committed: Fri Aug 28 18:35:46 2015 -0700 ---------------------------------------------------------------------- ci/tsqa/tests/test_body_factory.py | 1 - ci/tsqa/tests/test_custom_log.py | 3 +-- ci/tsqa/tests/test_headrequest.py | 11 +++++------ ci/tsqa/tests/test_hostdb.py | 1 - ci/tsqa/tests/test_origin_min_keep_alive_connection.py | 11 +++++------ 5 files changed, 11 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/70f46438/ci/tsqa/tests/test_body_factory.py ---------------------------------------------------------------------- diff --git a/ci/tsqa/tests/test_body_factory.py b/ci/tsqa/tests/test_body_factory.py index fd8f8b5..6d123a2 100644 --- a/ci/tsqa/tests/test_body_factory.py +++ b/ci/tsqa/tests/test_body_factory.py @@ -20,7 +20,6 @@ Test body_factory import os import requests -import time import logging import SocketServer import random http://git-wip-us.apache.org/repos/asf/trafficserver/blob/70f46438/ci/tsqa/tests/test_custom_log.py ---------------------------------------------------------------------- diff --git a/ci/tsqa/tests/test_custom_log.py b/ci/tsqa/tests/test_custom_log.py index 37573b7..417af18 100644 --- a/ci/tsqa/tests/test_custom_log.py +++ b/ci/tsqa/tests/test_custom_log.py @@ -22,7 +22,6 @@ import os import requests import time import logging -import SocketServer import random import tsqa.test_cases import helpers @@ -36,7 +35,7 @@ class TestCustomLogField(helpers.EnvironmentCase): ''' @classmethod def setUpEnv(cls, env): - + cls.configs['remap.config'].add_line( 'map / http://www.linkedin.com/ @action=deny' ) http://git-wip-us.apache.org/repos/asf/trafficserver/blob/70f46438/ci/tsqa/tests/test_headrequest.py ---------------------------------------------------------------------- diff --git a/ci/tsqa/tests/test_headrequest.py b/ci/tsqa/tests/test_headrequest.py index a636db8..73736a5 100644 --- a/ci/tsqa/tests/test_headrequest.py +++ b/ci/tsqa/tests/test_headrequest.py @@ -18,7 +18,6 @@ Test Head Request # See the License for the specific language governing permissions and # limitations under the License. -import os import requests import time import logging @@ -34,7 +33,7 @@ log = logging.getLogger(__name__) class HeadRequestServerHandler(SocketServer.BaseRequestHandler): - """ + """ A subclass of RequestHandler which will response to head requests """ @@ -53,7 +52,7 @@ class HeadRequestServerHandler(SocketServer.BaseRequestHandler): 'Transfer-Encoding: chunked\r\n' 'Vary: Accept-Encoding\r\n' '\r\n' - ) + ) self.request.sendall(resp) elif 'CL' in data: resp = ('HTTP/1.1 200 OK\r\n' @@ -61,14 +60,14 @@ class HeadRequestServerHandler(SocketServer.BaseRequestHandler): 'Content-Length: 123\r\n' 'Vary: Accept-Encoding\r\n' '\r\n' - ) + ) self.request.sendall(resp) else: resp = ('HTTP/1.1 200 OK\r\n' 'Server: Apache-Coyote/1.1\r\n' 'Vary: Accept-Encoding\r\n' '\r\n' - ) + ) self.request.sendall(resp) @@ -105,7 +104,7 @@ class TestHeadRequestWithoutTimeout(helpers.EnvironmentCase): while 1: try: resp = conn.recv(4096) - if len(resp) == 0: + if len(resp) == 0: break response_content = resp log.info(resp) http://git-wip-us.apache.org/repos/asf/trafficserver/blob/70f46438/ci/tsqa/tests/test_hostdb.py ---------------------------------------------------------------------- diff --git a/ci/tsqa/tests/test_hostdb.py b/ci/tsqa/tests/test_hostdb.py index ded286c..3a9b800 100644 --- a/ci/tsqa/tests/test_hostdb.py +++ b/ci/tsqa/tests/test_hostdb.py @@ -72,7 +72,6 @@ class TestHostDBBadResolvConf(helpers.EnvironmentCase): }) def test_working(self): - start = time.time() ret = requests.get('http://trafficserver.readthedocs.org', proxies=self.proxies, ) http://git-wip-us.apache.org/repos/asf/trafficserver/blob/70f46438/ci/tsqa/tests/test_origin_min_keep_alive_connection.py ---------------------------------------------------------------------- diff --git a/ci/tsqa/tests/test_origin_min_keep_alive_connection.py b/ci/tsqa/tests/test_origin_min_keep_alive_connection.py index 741cd56..706c719 100644 --- a/ci/tsqa/tests/test_origin_min_keep_alive_connection.py +++ b/ci/tsqa/tests/test_origin_min_keep_alive_connection.py @@ -18,7 +18,6 @@ Test the configure entry : proxy.config.http.origin_min_keep_alive_connections # See the License for the specific language governing permissions and # limitations under the License. -import os import requests import time import logging @@ -69,10 +68,10 @@ class TestKeepAlive_Origin_Min_connections(helpers.EnvironmentCase): thread.start_new_thread(simple_socket_server, (cls.traffic_server_host, cls.socket_server_port, )) cls.configs['remap.config'].add_line('map / http://127.0.0.1:{0}'.format(cls.socket_server_port)) cls.origin_keep_alive_timeout = 3 - cls.configs['records.config']['CONFIG']['origin_min_keep_alive_connections'] = 1 - cls.configs['records.config']['CONFIG']['keep_alive_enabled_out'] = 1 + cls.configs['records.config']['CONFIG']['origin_min_keep_alive_connections'] = 1 + cls.configs['records.config']['CONFIG']['keep_alive_enabled_out'] = 1 cls.configs['records.config']['CONFIG']['proxy.config.http.keep_alive_no_activity_timeout_out'] = cls.origin_keep_alive_timeout - + def test_origin_min_connection(self): conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM) conn.connect((self.traffic_server_host, self.traffic_server_port)) @@ -91,7 +90,7 @@ class TestKeepAlive_Origin_Min_connections(helpers.EnvironmentCase): else: second_resp = resp break - if len(resp) == 0: + if len(resp) == 0: break time.sleep(2 + self.origin_keep_alive_timeout) conn.send(request_content) @@ -100,4 +99,4 @@ class TestKeepAlive_Origin_Min_connections(helpers.EnvironmentCase): conn.shutdown(socket.SHUT_RDWR) conn.close() self.assertEqual(first_resp, second_resp) - +
