MCPcopy Create free account
hub / github.com/psf/black / C

Class C

tests/data/simple_cases/comments4.py:9–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8
9class C:
10 @pytest.mark.parametrize(
11 ("post_data", "message"),
12 [
13 # metadata_version errors.
14 (
15 {},
16 "None is an invalid value for Metadata-Version. Error: This field is"
17 " required. see"
18 " https://packaging.python.org/specifications/core-metadata",
19 ),
20 (
21 {"metadata_version": "-1"},
22 "'-1' is an invalid value for Metadata-Version. Error: Unknown Metadata"
23 " Version see"
24 " https://packaging.python.org/specifications/core-metadata",
25 ),
26 # name errors.
27 (
28 {"metadata_version": "1.2"},
29 "'' is an invalid value for Name. Error: This field is required. see"
30 " https://packaging.python.org/specifications/core-metadata",
31 ),
32 (
33 {"metadata_version": "1.2", "name": "foo-"},
34 "'foo-' is an invalid value for Name. Error: Must start and end with a"
35 " letter or numeral and contain only ascii numeric and '.', '_' and"
36 " '-'. see https://packaging.python.org/specifications/core-metadata",
37 ),
38 # version errors.
39 (
40 {"metadata_version": "1.2", "name": "example"},
41 "'' is an invalid value for Version. Error: This field is required. see"
42 " https://packaging.python.org/specifications/core-metadata",
43 ),
44 (
45 {"metadata_version": "1.2", "name": "example", "version": "dog"},
46 "'dog' is an invalid value for Version. Error: Must start and end with"
47 " a letter or numeral and contain only ascii numeric and '.', '_' and"
48 " '-'. see https://packaging.python.org/specifications/core-metadata",
49 ),
50 ],
51 )
52 def test_fails_invalid_post_data(
53 self, pyramid_config, db_request, post_data, message
54 ):
55 pyramid_config.testing_securitypolicy(userid=1)
56 db_request.POST = MultiDict(post_data)
57
58
59def foo(list_a, list_b):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected