[Webkit-unassigned] [Bug 221981] [LayoutTests] Convert http/tests/misc convert PHP to Python

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 18 11:06:45 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=221981

--- Comment #8 from Jonathan Bedard <jbedard at apple.com> ---
Comment on attachment 420792
  --> https://bugs.webkit.org/attachment.cgi?id=420792
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=420792&action=review

> LayoutTests/http/tests/misc/resources/charset-sniffer-end-sniffing.py:15
> +for i in range(0, 10000):

The usual idiom when you have a variable that you need to complete a statement but that you are not actually going to use is to use '_'

> LayoutTests/http/tests/misc/resources/check-test-file.py:28
> +        'PASS: File upload was successful\n'

Is there any "error" equivalent in Python? This code isn't exactly the same, although it's the same in the successful case, so that's probably sufficient.

> LayoutTests/http/tests/misc/resources/check-unnamed-file-included-in-formdata.py:23
> +if data != None:

Style is to use "data is not None" in this case.

> LayoutTests/http/tests/misc/resources/redirect-to-http-url.py:1
> +#!/usr/bin/env python3

Is there a php file being removed here?

> LayoutTests/http/tests/misc/resources/referrer-main-resource.py:6
> +referer = os.environ.get('HTTP_REFERER', '')

Don't need the default empty string (since you aren't printing it) and you probably don't need the variable either and could just put the os.environ.get in the if statement

> LayoutTests/http/tests/misc/resources/referrer-result.py:14
> +# formatting string

Remove this comment. I suspect the issue is about the brackets in the string, and can be mitigated with double brackets, but it's not a huge issue if these stay as "prints"

> LayoutTests/http/tests/misc/resources/stylesheet-bad-mime-type.py:18
> +    sys.stdout.write('\r\n')

I think we want the 406 status code here

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210218/fd664a7f/attachment-0001.htm>


More information about the webkit-unassigned mailing list