(self)
| 185 | self._test_urls([url], cache_handlers, retry=False) |
| 186 | |
| 187 | def test_file(self): |
| 188 | TESTFN = os_helper.TESTFN |
| 189 | f = open(TESTFN, 'w') |
| 190 | try: |
| 191 | f.write('hi there\n') |
| 192 | f.close() |
| 193 | urls = [ |
| 194 | urllib.request.pathname2url(os.path.abspath(TESTFN), add_scheme=True), |
| 195 | ('file:///nonsensename/etc/passwd', None, |
| 196 | urllib.error.URLError), |
| 197 | ] |
| 198 | self._test_urls(urls, self._extra_handlers(), retry=True) |
| 199 | finally: |
| 200 | os.remove(TESTFN) |
| 201 | |
| 202 | self.assertRaises(ValueError, urllib.request.urlopen,'./relative_path/to/file') |
| 203 | |
| 204 | # XXX Following test depends on machine configurations that are internal |
| 205 | # to CNRI. Need to set up a public server with the right authentication |
nothing calls this directly
no test coverage detected