Improve formatting of Python files (#30919)

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
This commit is contained in:
Taym Haddadi 2023-12-25 00:58:37 +01:00 committed by GitHub
parent df157dcc03
commit 554b35b705
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 48 additions and 54 deletions

View file

@ -54,9 +54,9 @@ def print_line(value1, value2, key):
for key in keys:
value1 = data1.get(key)
value2 = data2.get(key)
if value1 and not(value2):
if value1 and not (value2):
print("{}Test {}: missing from {}.{}".format(WARNING, key, args.file2, END))
elif value2 and not(value1):
elif value2 and not (value1):
print("{}Test {}: missing from {}.{}".format(WARNING, key, args.file1, END))
elif value1 and value2:
total1 += value1

View file

@ -63,7 +63,7 @@ Shutting down the Constellation after generating an output file or exit flag spe
"loadEventEnd": None
}]
result = runner.parse_log(mock_log, mock_url)
assert(expected == list(result))
assert (expected == list(result))
def test_log_parser_complex():
@ -146,7 +146,7 @@ Shutting down the Constellation after generating an output file or exit flag spe
"loadEventEnd": None
}]
result = runner.parse_log(mock_log, mock_url)
assert(expected == list(result))
assert (expected == list(result))
def test_log_parser_empty():
@ -187,7 +187,7 @@ def test_log_parser_empty():
"loadEventEnd": -1
}]
result = runner.parse_log(mock_log, mock_testcase)
assert(expected == list(result))
assert (expected == list(result))
def test_log_parser_error():
@ -220,7 +220,7 @@ def test_log_parser_error():
"loadEventEnd": -1
}]
result = runner.parse_log(mock_log, mock_testcase)
assert(expected == list(result))
assert (expected == list(result))
def test_log_parser_bad_testcase_name():
@ -280,7 +280,7 @@ Shutting down the Constellation after generating an output file or exit flag spe
"loadEventEnd": -1
}]
result = runner.parse_log(mock_log, mock_testcase)
assert(expected == list(result))
assert (expected == list(result))
def test_manifest_loader():
@ -297,7 +297,7 @@ http://localhost/page_load_test/tp5n/aljazeera.net/aljazeera.net/portal.html
("http://localhost/page_load_test/tp5n/56.com/www.56.com/index.html", False),
("http://localhost/page_load_test/tp5n/aljazeera.net/aljazeera.net/portal.html", False)
]
assert(expected == list(runner.parse_manifest(text)))
assert (expected == list(runner.parse_manifest(text)))
def test_manifest_loader_async():
@ -310,7 +310,7 @@ async http://localhost/page_load_test/tp5n/56.com/www.56.com/index.html
("http://localhost/page_load_test/tp5n/163.com/www.163.com/index.html", False),
("http://localhost/page_load_test/tp5n/56.com/www.56.com/index.html", True),
]
assert(expected == list(runner.parse_manifest(text)))
assert (expected == list(runner.parse_manifest(text)))
def test_filter_result_by_manifest():
@ -334,7 +334,7 @@ def test_filter_result_by_manifest():
("http://localhost:8000/page_load_test/56.com/www.56.com/index.html", False)
]
assert(expected == runner.filter_result_by_manifest(input_json, manifest))
assert (expected == runner.filter_result_by_manifest(input_json, manifest))
def test_filter_result_by_manifest_error():
@ -374,7 +374,7 @@ def test_take_result_median_odd():
"domLoading": 1460358380002
}]
assert(expected == runner.take_result_median(input_json, len(input_json)))
assert (expected == runner.take_result_median(input_json, len(input_json)))
def test_take_result_median_even():
@ -394,7 +394,7 @@ def test_take_result_median_even():
"domLoading": 1460358380001.5
}]
assert(expected == runner.take_result_median(input_json, len(input_json)))
assert (expected == runner.take_result_median(input_json, len(input_json)))
def test_take_result_median_error():
@ -414,7 +414,7 @@ def test_take_result_median_error():
"domLoading": 1460358380001.5
}]
assert(expected == runner.take_result_median(input_json, len(input_json)))
assert (expected == runner.take_result_median(input_json, len(input_json)))
def test_log_result():
@ -437,4 +437,4 @@ Failure summary:
- http://localhost:8000/page_load_test/56.com/www.56.com/index.html
========================================
"""
assert(expected == runner.format_result_summary(results))
assert (expected == runner.format_result_summary(results))

View file

@ -8,18 +8,18 @@ import submit_to_perfherder
def test_format_testcase_name():
assert('about:blank' == submit_to_perfherder.format_testcase_name(
'about:blank'))
assert('163.com' == submit_to_perfherder.format_testcase_name((
'http://localhost:8000/page_load_test/163.com/p.mail.163.com/'
'mailinfo/shownewmsg_www_1222.htm.html')))
assert(('1234567890223456789032345678904234567890'
assert ('about:blank' == submit_to_perfherder.format_testcase_name(
'about:blank'))
assert ('163.com' == submit_to_perfherder.format_testcase_name((
'http://localhost:8000/page_load_test/163.com/p.mail.163.com/'
'mailinfo/shownewmsg_www_1222.htm.html')))
assert (('1234567890223456789032345678904234567890'
'5234567890623456789072345678908234567890')
== submit_to_perfherder.format_testcase_name((
'1234567890223456789032345678904234567890'
'52345678906234567890723456789082345678909234567890')))
assert('news.ycombinator.com' == submit_to_perfherder.format_testcase_name(
'http://localhost:8000/tp6/news.ycombinator.com/index.html'))
== submit_to_perfherder.format_testcase_name((
'1234567890223456789032345678904234567890'
'52345678906234567890723456789082345678909234567890')))
assert ('news.ycombinator.com' == submit_to_perfherder.format_testcase_name(
'http://localhost:8000/tp6/news.ycombinator.com/index.html'))
def test_format_perf_data():
@ -94,7 +94,7 @@ def test_format_perf_data():
}
}
result = submit_to_perfherder.format_perf_data(mock_result)
assert(expected == result)
assert (expected == result)
def test_format_bad_perf_data():
@ -131,4 +131,4 @@ def test_format_bad_perf_data():
}
}
result = submit_to_perfherder.format_perf_data(mock_result)
assert(expected == result)
assert (expected == result)