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

Method test_overwrite_dir_as_file

Lib/test/archiver_tests.py:52–59  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

50 self.assertEqual(f.read(), b'newcontent')
51
52 def test_overwrite_dir_as_file(self):
53 target = os.path.join(self.testdir, 'test')
54 os.mkdir(target)
55 with self.open(self.ar_with_file) as ar:
56 with self.assertRaises(PermissionError if sys.platform == 'win32'
57 else IsADirectoryError):
58 self.extractall(ar)
59 self.assertTrue(os.path.isdir(target))
60
61 def test_overwrite_file_as_dir(self):
62 target = os.path.join(self.testdir, 'test')

Callers

nothing calls this directly

Calls 7

openMethod · 0.95
extractallMethod · 0.95
assertTrueMethod · 0.80
joinMethod · 0.45
mkdirMethod · 0.45
assertRaisesMethod · 0.45
isdirMethod · 0.45

Tested by

no test coverage detected