(self)
| 1152 | self.assertEqual(p_ds_req.unredirected_hdrs["Host"], "example.com") |
| 1153 | |
| 1154 | def test_full_url_setter(self): |
| 1155 | # Checks to ensure that components are set correctly after setting the |
| 1156 | # full_url of a Request object |
| 1157 | |
| 1158 | urls = [ |
| 1159 | 'http://example.com?foo=bar#baz', |
| 1160 | 'http://example.com?foo=bar&spam=eggs#bash', |
| 1161 | 'http://example.com', |
| 1162 | ] |
| 1163 | |
| 1164 | # testing a reusable request instance, but the url parameter is |
| 1165 | # required, so just use a dummy one to instantiate |
| 1166 | r = Request('http://example.com') |
| 1167 | for url in urls: |
| 1168 | r.full_url = url |
| 1169 | parsed = urlsplit(url) |
| 1170 | |
| 1171 | self.assertEqual(r.get_full_url(), url) |
| 1172 | # full_url setter uses splittag to split into components. |
| 1173 | # splittag sets the fragment as None while urlparse sets it to '' |
| 1174 | self.assertEqual(r.fragment or '', parsed.fragment) |
| 1175 | self.assertEqual(urlsplit(r.get_full_url()).query, parsed.query) |
| 1176 | |
| 1177 | def test_full_url_deleter(self): |
| 1178 | r = Request('http://www.example.com') |
nothing calls this directly
no test coverage detected