(self)
| 1276 | class PythonCopyTestCase(CopyBaseTestCase, unittest.TestCase): |
| 1277 | |
| 1278 | def test_attributes(self): |
| 1279 | # Testing if attributes are of same type. |
| 1280 | h1 = hmac.HMAC.__new__(hmac.HMAC) |
| 1281 | h1._init_old(b"key", b"msg", digestmod="sha256") |
| 1282 | self.assertIsNone(h1._hmac) |
| 1283 | self.assertIsNotNone(h1._inner) |
| 1284 | self.assertIsNotNone(h1._outer) |
| 1285 | |
| 1286 | h2 = h1.copy() |
| 1287 | self.assertIsNone(h2._hmac) |
| 1288 | self.assertIsNotNone(h2._inner) |
| 1289 | self.assertIsNotNone(h2._outer) |
| 1290 | self.assertEqual(type(h1._inner), type(h2._inner)) |
| 1291 | self.assertEqual(type(h1._outer), type(h2._outer)) |
| 1292 | |
| 1293 | def test_realcopy(self): |
| 1294 | # Testing if the copy method created a real copy. |
nothing calls this directly
no test coverage detected