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 1
1
import json
2
2
import pathlib
3
- import urllib .request
4
3
5
4
import pytest
6
5
from urlpattern import URLPattern
7
6
7
+ # This test is based on the web-platform-tests Project.
8
+ #
8
9
# To update the test data:
9
10
#
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 `.
13
14
urlpatterntestdata_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 ())
19
15
urlpatterntestdata = json .loads (urlpatterntestdata_path .read_text ("utf-8" ))
20
16
21
17
You can’t perform that action at this time.
0 commit comments