|
3 | 3 |
|
4 | 4 | from cloudevents.pydantic.event_attribute_types import (
|
5 | 5 | AbsoluteURI,
|
6 |
| - URIReference, |
7 |
| - NonEmptyURIReference, |
8 |
| - NonEmptyAbsoluteURI, |
9 | 6 | ContentType,
|
| 7 | + NonEmptyAbsoluteURI, |
| 8 | + NonEmptyURIReference, |
| 9 | + URIReference, |
10 | 10 | )
|
11 | 11 |
|
12 | 12 | ABSOLUTE_URIS = [
|
13 |
| - u"urn:uuid:1ca85b01-40e5-44e7-8669-04d85c615a7c", |
14 |
| - u"ftp://1.1.1.1/asdasd", |
15 |
| - u"http://foobar.dk", |
16 |
| - u"http://foobar.museum/foobar", |
17 |
| - u"http://fo.com", |
18 |
| - u"http://FOO.com", |
19 |
| - u"http://foo.com/blah_blah", |
20 |
| - u"http://foo.com/blah_blah/", |
21 |
| - u"http://foo.com/blah_blah_(wikipedia)", |
22 |
| - u"http://foo.com/blah_blah_(wikipedia)_(again)", |
23 |
| - u"http://www.example.com/wpstyle/?p=364", |
24 |
| - u"https://www.example.com/foo/?bar=baz&inga=42&quux", |
25 |
| - u"https://www.example.com?bar=baz", |
26 |
| - u"http://userid:[email protected]:8080", |
27 |
| - u"http://userid:[email protected]:8080/", |
28 |
| - |
29 |
| - |
30 |
| - |
31 |
| - u"http://[email protected]:8080/", |
32 |
| - u"http://userid:[email protected]", |
33 |
| - u"http://userid:[email protected]/", |
34 |
| - u"http://142.42.1.1/", |
35 |
| - u"http://142.42.1.1:8080/", |
36 |
| - u"http://foo.com/blah_(wikipedia)#cite-1", |
37 |
| - u"http://foo.com/blah_(wikipedia)_blah#cite-1", |
38 |
| - u"http://foo.com/(something)?after=parens", |
39 |
| - u"http://code.google.com/events/#&product=browser", |
40 |
| - u"http://j.mp", |
41 |
| - u"ftp://foo.bar/baz", |
42 |
| - u"http://foo.bar/?q=Test%20URL-encoded%20stuff", |
43 |
| - u"http://xn--d5b6ci4b4b3a.xn--54b7fta0cc", |
44 |
| - u"http://xn----gtbybh.xn--p1ai/1/asdf", |
45 |
| - u"http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com", |
46 |
| - u"http://1337.net", |
47 |
| - u"http://a.b-c.de", |
48 |
| - u"http://223.255.255.254", |
49 |
| - u"http://10.1.1.0", |
50 |
| - u"http://10.1.1.1", |
51 |
| - u"http://10.1.1.254", |
52 |
| - u"http://10.1.1.255", |
53 |
| - u"http://127.0.0.1:8080", |
54 |
| - u"http://127.0.10.150", |
55 |
| - u"http://localhost", |
56 |
| - u"http://localhost:8000", |
57 |
| - u"http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html", |
58 |
| - u"http://[1080:0:0:0:8:800:200C:417A]/index.html", |
59 |
| - u"http://[3ffe:2a00:100:7031::1]", |
60 |
| - u"http://[1080::8:800:200C:417A]/foo", |
61 |
| - u"http://[::192.9.5.5]/ipng", |
62 |
| - u"http://[::FFFF:129.144.52.38]:80/index.html", |
63 |
| - u"http://[2010:836B:4179::836B:4179]", |
| 13 | + "urn:uuid:1ca85b01-40e5-44e7-8669-04d85c615a7c", |
| 14 | + "ftp://1.1.1.1/asdasd", |
| 15 | + "http://foobar.dk", |
| 16 | + "http://foobar.museum/foobar", |
| 17 | + "http://fo.com", |
| 18 | + "http://FOO.com", |
| 19 | + "http://foo.com/blah_blah", |
| 20 | + "http://foo.com/blah_blah/", |
| 21 | + "http://foo.com/blah_blah_(wikipedia)", |
| 22 | + "http://foo.com/blah_blah_(wikipedia)_(again)", |
| 23 | + "http://www.example.com/wpstyle/?p=364", |
| 24 | + "https://www.example.com/foo/?bar=baz&inga=42&quux", |
| 25 | + "https://www.example.com?bar=baz", |
| 26 | + "http://userid:[email protected]:8080", |
| 27 | + "http://userid:[email protected]:8080/", |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + "http://userid:[email protected]", |
| 33 | + "http://userid:[email protected]/", |
| 34 | + "http://142.42.1.1/", |
| 35 | + "http://142.42.1.1:8080/", |
| 36 | + "http://foo.com/blah_(wikipedia)#cite-1", |
| 37 | + "http://foo.com/blah_(wikipedia)_blah#cite-1", |
| 38 | + "http://foo.com/(something)?after=parens", |
| 39 | + "http://code.google.com/events/#&product=browser", |
| 40 | + "http://j.mp", |
| 41 | + "ftp://foo.bar/baz", |
| 42 | + "http://foo.bar/?q=Test%20URL-encoded%20stuff", |
| 43 | + "http://xn--d5b6ci4b4b3a.xn--54b7fta0cc", |
| 44 | + "http://xn----gtbybh.xn--p1ai/1/asdf", |
| 45 | + "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com", |
| 46 | + "http://1337.net", |
| 47 | + "http://a.b-c.de", |
| 48 | + "http://223.255.255.254", |
| 49 | + "http://10.1.1.0", |
| 50 | + "http://10.1.1.1", |
| 51 | + "http://10.1.1.254", |
| 52 | + "http://10.1.1.255", |
| 53 | + "http://127.0.0.1:8080", |
| 54 | + "http://127.0.10.150", |
| 55 | + "http://localhost", |
| 56 | + "http://localhost:8000", |
| 57 | + "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html", |
| 58 | + "http://[1080:0:0:0:8:800:200C:417A]/index.html", |
| 59 | + "http://[3ffe:2a00:100:7031::1]", |
| 60 | + "http://[1080::8:800:200C:417A]/foo", |
| 61 | + "http://[::192.9.5.5]/ipng", |
| 62 | + "http://[::FFFF:129.144.52.38]:80/index.html", |
| 63 | + "http://[2010:836B:4179::836B:4179]", |
64 | 64 | ]
|
65 | 65 | NON_ABSOLUTE_URI_REFERENCES = [
|
66 |
| - u"foo.com/blah_(wikipedia)_blah#cite-1", |
67 |
| - u"foo.com/(something)?after=parens", |
68 |
| - u"damowmow.com/", |
69 |
| - u"code.google.com/events/#&product=browser", |
70 |
| - u"j.mp", |
71 |
| - u"foo.bar/baz", |
72 |
| - u"foo.bar/?q=Test%20URL-encoded%20stuff", |
73 |
| - u"xn--d5b6ci4b4b3a.xn--54b7fta0cc", |
74 |
| - u"xn----gtbybh.xn--p1ai/1/asdf", |
| 66 | + "foo.com/blah_(wikipedia)_blah#cite-1", |
| 67 | + "foo.com/(something)?after=parens", |
| 68 | + "damowmow.com/", |
| 69 | + "code.google.com/events/#&product=browser", |
| 70 | + "j.mp", |
| 71 | + "foo.bar/baz", |
| 72 | + "foo.bar/?q=Test%20URL-encoded%20stuff", |
| 73 | + "xn--d5b6ci4b4b3a.xn--54b7fta0cc", |
| 74 | + "xn----gtbybh.xn--p1ai/1/asdf", |
75 | 75 | ]
|
76 | 76 |
|
77 | 77 | NON_URI_STRINGS = [
|
78 |
| - u"http://☺.damowmow.com/", |
79 |
| - u"http://➡.ws/䨹", |
80 |
| - u"http://⌘.ws", |
81 |
| - u"http://⌘.ws/", |
| 78 | + "http://☺.damowmow.com/", |
| 79 | + "http://➡.ws/䨹", |
| 80 | + "http://⌘.ws", |
| 81 | + "http://⌘.ws/", |
82 | 82 | "a a",
|
83 | 83 | " ",
|
84 |
| - u"unicode_(✪)_in_parens", |
| 84 | + "unicode_(✪)_in_parens", |
85 | 85 | "http:// shouldfail.com",
|
86 | 86 | ":// should fail",
|
87 | 87 | 'http://example.com/">[email protected]',
|
88 |
| - u"http://✪df.ws/123", |
89 |
| - u"дом-м.рф/1/asdf", |
90 |
| - u"http://مثال.إختبار", |
91 |
| - u"http://例子.测试", |
92 |
| - u"http://उदाहरण.परीक्षा", |
93 |
| - u"http://www.😉.com", |
94 |
| - u"http://😉.com/😁", |
95 |
| - u"http://উদাহরণ.বাংলা", |
96 |
| - u"مثال.إختبار", |
97 |
| - u"例子.测试", |
98 |
| - u"उदाहरण.परीक्षा", |
99 |
| - u"www.😉.com", |
100 |
| - u"com/😁", |
101 |
| - u"উদাহরণ.বাংলা", |
102 |
| - u"http://foo.com/unicode_(✪)_in_parens", |
| 88 | + "http://✪df.ws/123", |
| 89 | + "дом-м.рф/1/asdf", |
| 90 | + "http://مثال.إختبار", |
| 91 | + "http://例子.测试", |
| 92 | + "http://उदाहरण.परीक्षा", |
| 93 | + "http://www.😉.com", |
| 94 | + "http://😉.com/😁", |
| 95 | + "http://উদাহরণ.বাংলা", |
| 96 | + "مثال.إختبار", |
| 97 | + "例子.测试", |
| 98 | + "उदाहरण.परीक्षा", |
| 99 | + "www.😉.com", |
| 100 | + "com/😁", |
| 101 | + "উদাহরণ.বাংলা", |
| 102 | + "http://foo.com/unicode_(✪)_in_parens", |
103 | 103 | ]
|
104 | 104 |
|
105 | 105 |
|
|
0 commit comments