зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1672668 [wpt PR 26184] - Python 3: replace deprecated Assertregexpmatches use for Py3, a=testonly
Automatic update from web-platform-tests Python 3: replace deprecated Assertregexpmatches use for Py3 (#26184) -- wpt-commits: 38a1e0ae8147790ff3f9c6314dbca88be62299d0 wpt-pr: 26184
This commit is contained in:
Родитель
8a3a51644f
Коммит
8e6352906f
|
@ -3,6 +3,7 @@ import unittest
|
|||
import time
|
||||
import json
|
||||
|
||||
from six import assertRegex
|
||||
from six.moves import urllib
|
||||
|
||||
import pytest
|
||||
|
@ -43,11 +44,11 @@ class TestHeader(TestUsingServer):
|
|||
self.assertEqual(resp.info()["Refresh"], "3;url=http://example.com")
|
||||
|
||||
def test_escape_comma(self):
|
||||
resp = self.request("/document.txt", query="pipe=header(Expires,Thu\,%2014%20Aug%201986%2018:00:00%20GMT)")
|
||||
resp = self.request("/document.txt", query=r"pipe=header(Expires,Thu\,%2014%20Aug%201986%2018:00:00%20GMT)")
|
||||
self.assertEqual(resp.info()["Expires"], "Thu, 14 Aug 1986 18:00:00 GMT")
|
||||
|
||||
def test_escape_parenthesis(self):
|
||||
resp = self.request("/document.txt", query="pipe=header(User-Agent,Mozilla/5.0%20(X11;%20Linux%20x86_64;%20rv:12.0\)")
|
||||
resp = self.request("/document.txt", query=r"pipe=header(User-Agent,Mozilla/5.0%20(X11;%20Linux%20x86_64;%20rv:12.0\)")
|
||||
self.assertEqual(resp.info()["User-Agent"], "Mozilla/5.0 (X11; Linux x86_64; rv:12.0)")
|
||||
|
||||
class TestSlice(TestUsingServer):
|
||||
|
@ -120,7 +121,7 @@ server: http://localhost:{0}""".format(self.server.port).encode("ascii")
|
|||
|
||||
def test_sub_uuid(self):
|
||||
resp = self.request("/sub_uuid.sub.txt")
|
||||
self.assertRegexpMatches(resp.read().rstrip(), b"Before [a-f0-9-]+ After")
|
||||
assertRegex(self, resp.read().rstrip(), b"Before [a-f0-9-]+ After")
|
||||
|
||||
def test_sub_var(self):
|
||||
resp = self.request("/sub_var.sub.txt")
|
||||
|
|
Загрузка…
Ссылка в новой задаче