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

Method test_basic

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

Source from the content-addressed store, hash-verified

165 os_helper.unlink(file_location)
166
167 def test_basic(self):
168 # Test basic functionality.
169 with self.urlretrieve(self.logo) as (file_location, info):
170 self.assertTrue(os.path.exists(file_location), "file location returned by"
171 " urlretrieve is not a valid path")
172 with open(file_location, 'rb') as f:
173 self.assertTrue(f.read(), "reading from the file location returned"
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.

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected