(self)
| 497 | ) |
| 498 | |
| 499 | def test_copy(self): |
| 500 | all_pairs = [("A", "1"), ("A", "2"), ("B", "c")] |
| 501 | h1 = HTTPHeaders() |
| 502 | for k, v in all_pairs: |
| 503 | h1.add(k, v) |
| 504 | h2 = h1.copy() |
| 505 | h3 = copy.copy(h1) |
| 506 | h4 = copy.deepcopy(h1) |
| 507 | for headers in [h1, h2, h3, h4]: |
| 508 | # All the copies are identical, no matter how they were |
| 509 | # constructed. |
| 510 | self.assertEqual(list(sorted(headers.get_all())), all_pairs) |
| 511 | for headers in [h2, h3, h4]: |
| 512 | # Neither the dict or its member lists are reused. |
| 513 | self.assertIsNot(headers, h1) |
| 514 | self.assertIsNot(headers.get_list("A"), h1.get_list("A")) |
| 515 | |
| 516 | def test_pickle_roundtrip(self): |
| 517 | headers = HTTPHeaders() |
nothing calls this directly
no test coverage detected