(self)
| 268 | |
| 269 | @unittest.skipIf(get_fips_mode(), "skip in FIPS mode") |
| 270 | def test_clinic_signature(self): |
| 271 | for constructor in self.hash_constructors: |
| 272 | with self.subTest(constructor.__name__): |
| 273 | constructor(b'') |
| 274 | constructor(data=b'') |
| 275 | with self.assertWarnsRegex(DeprecationWarning, |
| 276 | DEPRECATED_STRING_PARAMETER): |
| 277 | constructor(string=b'') |
| 278 | |
| 279 | digest_name = constructor(b'').name |
| 280 | with self.subTest(digest_name): |
| 281 | hashlib.new(digest_name, b'') |
| 282 | hashlib.new(digest_name, data=b'') |
| 283 | with self.assertWarnsRegex(DeprecationWarning, |
| 284 | DEPRECATED_STRING_PARAMETER): |
| 285 | hashlib.new(digest_name, string=b'') |
| 286 | # Make sure that _hashlib contains the constructor |
| 287 | # to test when using a combination of libcrypto and |
| 288 | # interned hash implementations. |
| 289 | if self._hashlib and digest_name in self._hashlib._constructors: |
| 290 | self._hashlib.new(digest_name, b'') |
| 291 | self._hashlib.new(digest_name, data=b'') |
| 292 | with self.assertWarnsRegex(DeprecationWarning, |
| 293 | DEPRECATED_STRING_PARAMETER): |
| 294 | self._hashlib.new(digest_name, string=b'') |
| 295 | |
| 296 | @unittest.skipIf(get_fips_mode(), "skip in FIPS mode") |
| 297 | def test_clinic_signature_errors(self): |
nothing calls this directly
no test coverage detected