MCPcopy Index your code
hub / github.com/python/cpython / test_specified_path

Method test_specified_path

Lib/test/test_urllibnet.py:176–183  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

174 " by urlretrieve failed")
175
176 def test_specified_path(self):
177 # Make sure that specifying the location of the file to write to works.
178 with self.urlretrieve(self.logo,
179 os_helper.TESTFN) as (file_location, info):
180 self.assertEqual(file_location, os_helper.TESTFN)
181 self.assertTrue(os.path.exists(file_location))
182 with open(file_location, 'rb') as f:
183 self.assertTrue(f.read(), "reading from temporary file failed")
184
185 def test_header(self):
186 # Make sure header returned as 2nd value from urlretrieve is good.

Callers

nothing calls this directly

Calls 6

urlretrieveMethod · 0.95
assertTrueMethod · 0.80
openFunction · 0.50
assertEqualMethod · 0.45
existsMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected