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

Method test_overwrite_file_as_dir

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

Source from the content-addressed store, hash-verified

59 self.assertTrue(os.path.isdir(target))
60
61 def test_overwrite_file_as_dir(self):
62 target = os.path.join(self.testdir, 'test')
63 self.create_file(target, b'content')
64 with self.open(self.ar_with_dir) as ar:
65 with self.assertRaises(FileExistsError):
66 self.extractall(ar)
67 self.assertTrue(os.path.isfile(target))
68 with open(target, 'rb') as f:
69 self.assertEqual(f.read(), b'content')
70
71 def test_overwrite_file_as_implicit_dir(self):
72 target = os.path.join(self.testdir, 'test')

Callers

nothing calls this directly

Calls 10

create_fileMethod · 0.95
openMethod · 0.95
extractallMethod · 0.95
assertTrueMethod · 0.80
openFunction · 0.50
joinMethod · 0.45
assertRaisesMethod · 0.45
isfileMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected