| 82 | |
| 83 | |
| 84 | class C: |
| 85 | @pytest.mark.parametrize( |
| 86 | ("post_data", "message"), |
| 87 | [ |
| 88 | # metadata_version errors. |
| 89 | ( |
| 90 | {}, |
| 91 | "None is an invalid value for Metadata-Version. Error: This field is" |
| 92 | " required. see" |
| 93 | " https://packaging.python.org/specifications/core-metadata" |
| 94 | ), |
| 95 | ( |
| 96 | {"metadata_version": "-1"}, |
| 97 | "'-1' is an invalid value for Metadata-Version. Error: Unknown Metadata" |
| 98 | " Version see" |
| 99 | " https://packaging.python.org/specifications/core-metadata" |
| 100 | ), |
| 101 | # name errors. |
| 102 | ( |
| 103 | {"metadata_version": "1.2"}, |
| 104 | "'' is an invalid value for Name. Error: This field is required. see" |
| 105 | " https://packaging.python.org/specifications/core-metadata" |
| 106 | ), |
| 107 | ( |
| 108 | {"metadata_version": "1.2", "name": "foo-"}, |
| 109 | "'foo-' is an invalid value for Name. Error: Must start and end with a" |
| 110 | " letter or numeral and contain only ascii numeric and '.', '_' and" |
| 111 | " '-'. see https://packaging.python.org/specifications/core-metadata" |
| 112 | ), |
| 113 | # version errors. |
| 114 | ( |
| 115 | {"metadata_version": "1.2", "name": "example"}, |
| 116 | "'' is an invalid value for Version. Error: This field is required. see" |
| 117 | " https://packaging.python.org/specifications/core-metadata" |
| 118 | ), |
| 119 | ( |
| 120 | {"metadata_version": "1.2", "name": "example", "version": "dog"}, |
| 121 | "'dog' is an invalid value for Version. Error: Must start and end with" |
| 122 | " a letter or numeral and contain only ascii numeric and '.', '_' and" |
| 123 | " '-'. see https://packaging.python.org/specifications/core-metadata" |
| 124 | ) |
| 125 | ] |
| 126 | ) |
| 127 | def test_fails_invalid_post_data( |
| 128 | self, pyramid_config, db_request, post_data, message |
| 129 | ): |
| 130 | ... |
| 131 | |
| 132 | square = Square(4) # type: Optional[Square] |
| 133 |
nothing calls this directly
no outgoing calls
no test coverage detected