(self)
| 1902 | self.assertIn("name='foo1', value='bar'", repr(new_c)) |
| 1903 | |
| 1904 | def test_netscape_misc(self): |
| 1905 | # Some additional Netscape cookies tests. |
| 1906 | c = CookieJar() |
| 1907 | headers = [] |
| 1908 | req = urllib.request.Request("http://foo.bar.acme.com/foo") |
| 1909 | |
| 1910 | # Netscape allows a host part that contains dots |
| 1911 | headers.append("Set-Cookie: Customer=WILE_E_COYOTE; domain=.acme.com") |
| 1912 | res = FakeResponse(headers, "http://www.acme.com/foo") |
| 1913 | c.extract_cookies(res, req) |
| 1914 | |
| 1915 | # and that the domain is the same as the host without adding a leading |
| 1916 | # dot to the domain. Should not quote even if strange chars are used |
| 1917 | # in the cookie value. |
| 1918 | headers.append("Set-Cookie: PART_NUMBER=3,4; domain=foo.bar.acme.com") |
| 1919 | res = FakeResponse(headers, "http://www.acme.com/foo") |
| 1920 | c.extract_cookies(res, req) |
| 1921 | |
| 1922 | req = urllib.request.Request("http://foo.bar.acme.com/foo") |
| 1923 | c.add_cookie_header(req) |
| 1924 | self.assertIn("PART_NUMBER=3,4", req.get_header("Cookie")) |
| 1925 | self.assertIn("Customer=WILE_E_COYOTE",req.get_header("Cookie")) |
| 1926 | |
| 1927 | def test_intranet_domains_2965(self): |
| 1928 | # Test handling of local intranet hostnames without a dot. |
nothing calls this directly
no test coverage detected