(self)
| 774 | self.assertTrue(any(t != loop_thread for t in called_threads)) |
| 775 | |
| 776 | def test_multiple_cookie_headers_http2(self): |
| 777 | test_cases = [ |
| 778 | { |
| 779 | "label": "RFC-compliant headers (no semicolon)", |
| 780 | "headers": [ |
| 781 | (b"cookie", b"a=abc"), |
| 782 | (b"cookie", b"b=def"), |
| 783 | (b"cookie", b"c=ghi"), |
| 784 | ], |
| 785 | }, |
| 786 | { |
| 787 | # Some clients may send cookies with trailing semicolons. |
| 788 | "label": "Headers with trailing semicolons", |
| 789 | "headers": [ |
| 790 | (b"cookie", b"a=abc;"), |
| 791 | (b"cookie", b"b=def;"), |
| 792 | (b"cookie", b"c=ghi;"), |
| 793 | ], |
| 794 | }, |
| 795 | ] |
| 796 | |
| 797 | for case in test_cases: |
| 798 | with self.subTest(case["label"]): |
| 799 | scope = self.async_request_factory._base_scope( |
| 800 | path="/", http_version="2.0" |
| 801 | ) |
| 802 | scope["headers"] = case["headers"] |
| 803 | request = ASGIRequest(scope, None) |
| 804 | self.assertEqual(request.META["HTTP_COOKIE"], "a=abc; b=def; c=ghi") |
| 805 | self.assertEqual(request.COOKIES, {"a": "abc", "b": "def", "c": "ghi"}) |
| 806 | |
| 807 | |
| 808 | class MaxMemorySizeASGITests(SimpleTestCase): |
nothing calls this directly
no test coverage detected