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

Method test_delete_inner_junction

Lib/test/test_pathlib/test_pathlib.py:2194–2215  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2192
2193 @needs_windows
2194 def test_delete_inner_junction(self):
2195 import _winapi
2196 tmp = self.cls(self.base, 'delete')
2197 tmp.mkdir()
2198 dir1 = tmp / 'dir1'
2199 dir2 = dir1 / 'dir2'
2200 dir3 = tmp / 'dir3'
2201 for d in dir1, dir2, dir3:
2202 d.mkdir()
2203 file1 = tmp / 'file1'
2204 file1.write_text('foo')
2205 link1 = dir1 / 'link1'
2206 _winapi.CreateJunction(str(dir2), str(link1))
2207 link2 = dir1 / 'link2'
2208 _winapi.CreateJunction(str(dir3), str(link2))
2209 link3 = dir1 / 'link3'
2210 _winapi.CreateJunction(str(file1), str(link3))
2211 # make sure junctions are removed but not followed
2212 dir1._delete()
2213 self.assertFalse(dir1.exists())
2214 self.assertTrue(dir3.exists())
2215 self.assertTrue(file1.exists())
2216
2217 @needs_windows
2218 def test_delete_outer_junction(self):

Callers

nothing calls this directly

Calls 8

strFunction · 0.85
assertFalseMethod · 0.80
assertTrueMethod · 0.80
clsMethod · 0.45
mkdirMethod · 0.45
write_textMethod · 0.45
_deleteMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected