File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 11import json
22import pathlib
3- import urllib .request
43
54import pytest
65from urlpattern import URLPattern
76
7+ # This test is based on the web-platform-tests Project.
8+ #
89# To update the test data:
910#
10- # 1. Remove tests/urlpatterntestdata.json.
11- # 2. Update the URL .
12- # 2. Run `pytest `.
11+ # 1. Go to https://github.com/web-platform- tests/wpt/blob/master/urlpattern/resources /urlpatterntestdata.json.
12+ # 2. Copy the content .
13+ # 3. Paste into `tests/urlpatterntestdata.json `.
1314urlpatterntestdata_path = pathlib .Path ("tests/urlpatterntestdata.json" )
14- if not urlpatterntestdata_path .exists ():
15- with urllib .request .urlopen (
16- "https://raw.githubusercontent.com/web-platform-tests/wpt/3ce3e9794fcd97ff24506f5c5325f91fc00ef79c/urlpattern/resources/urlpatterntestdata.json"
17- ) as f :
18- urlpatterntestdata_path .write_bytes (f .read ())
1915urlpatterntestdata = json .loads (urlpatterntestdata_path .read_text ("utf-8" ))
2016
2117
You can’t perform that action at this time.
0 commit comments