aboutsummaryrefslogtreecommitdiffstats
path: root/tests/jquery
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2015-06-03 20:29:13 -0400
committerCorey Farwell <coreyf@rwell.org>2015-06-04 11:17:34 -0400
commit848c57653ce1b023a324fb9442059228f5372188 (patch)
treeb7ca6475822fcc2220bfb3d5f76b8d6f5775b957 /tests/jquery
parent907c051bd1d59621449a399ccf6845b617bdff9d (diff)
downloadservo-848c57653ce1b023a324fb9442059228f5372188.tar.gz
servo-848c57653ce1b023a324fb9442059228f5372188.zip
Add flake8 to the tidy process for Python files
Fixes #6236 Also included in this commit are the changes need to make flake8 pass for the existing python file
Diffstat (limited to 'tests/jquery')
-rwxr-xr-xtests/jquery/run_jquery.py42
1 files changed, 24 insertions, 18 deletions
diff --git a/tests/jquery/run_jquery.py b/tests/jquery/run_jquery.py
index ac5398a12d1..42b3da9cdb5 100755
--- a/tests/jquery/run_jquery.py
+++ b/tests/jquery/run_jquery.py
@@ -22,24 +22,24 @@ import urlparse
# See https://github.com/servo/servo/issues/6210 and
# https://github.com/servo/servo/issues/6211
JQUERY_MODULES = [
- #"ajax", # panics
- #"attributes",
- #"callbacks",
- #"core", # mozjs crash
- #"css",
- #"data",
- #"deferred",
- #"dimensions",
- #"effects",
- #"event", # panics
- #"manipulation", # mozjs crash
- #"offset",
- #"queue",
+ # "ajax", # panics
+ # "attributes",
+ # "callbacks",
+ # "core", # mozjs crash
+ # "css",
+ # "data",
+ # "deferred",
+ # "dimensions",
+ # "effects",
+ # "event", # panics
+ # "manipulation", # mozjs crash
+ # "offset",
+ # "queue",
"selector",
- #"serialize",
- #"support",
- #"traversing",
- #"wrap"
+ # "serialize",
+ # "support",
+ # "traversing",
+ # "wrap"
]
# Port to run the HTTP server on for jQuery.
@@ -48,6 +48,7 @@ TEST_SERVER_PORT = 8192
# A regex for matching console.log output lines from the test runner.
REGEX_PATTERN = "^\[jQuery test\] \[([0-9]+)/([0-9]+)/([0-9]+)] (.*)"
+
# The result of a single test group.
class TestResult:
def __init__(self, success, fail, total, text):
@@ -94,7 +95,7 @@ def parse_string_to_results(buffer):
# Run servo and print / parse the results for a specific jQuery test module.
def run_servo(servo_exe, module):
url = "http://localhost:{0}/jquery/test/?module={1}".format(TEST_SERVER_PORT, module)
- args = [ servo_exe, url, "-z", "-f" ]
+ args = [servo_exe, url, "-z", "-f"]
proc = subprocess.Popen(args, stdout=subprocess.PIPE)
while True:
line = proc.stdout.readline()
@@ -107,26 +108,31 @@ def run_servo(servo_exe, module):
except AttributeError:
pass
+
# Build the filename for an expected results file.
def module_filename(module):
return 'expected_{0}.txt'.format(module)
+
# Read an existing set of expected results to compare against.
def read_existing_results(module):
with open(module_filename(module), 'r') as file:
buffer = file.read()
return parse_string_to_results(buffer)
+
# Write a set of results to file
def write_results(module, results):
with open(module_filename(module), 'w') as file:
for result in test_results.itervalues():
file.write(result.text + '\n')
+
# Print usage if command line args are incorrect
def print_usage():
print("USAGE: {0} servo_binary jquery_base_dir test|update".format(sys.argv[0]))
+
# Run a simple HTTP server to serve up the jQuery test suite
def run_http_server():
class ThreadingSimpleServer(SocketServer.ThreadingMixIn,