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

Method test_delete_dir

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

Source from the content-addressed store, hash-verified

2104 self.assertFileNotFound(p._delete)
2105
2106 def test_delete_dir(self):
2107 base = self.cls(self.base)
2108 base.joinpath('dirA')._delete()
2109 self.assertFalse(base.joinpath('dirA').exists())
2110 self.assertFalse(base.joinpath('dirA', 'linkC').exists(
2111 follow_symlinks=False))
2112 base.joinpath('dirB')._delete()
2113 self.assertFalse(base.joinpath('dirB').exists())
2114 self.assertFalse(base.joinpath('dirB', 'fileB').exists())
2115 self.assertFalse(base.joinpath('dirB', 'linkD').exists(
2116 follow_symlinks=False))
2117 base.joinpath('dirC')._delete()
2118 self.assertFalse(base.joinpath('dirC').exists())
2119 self.assertFalse(base.joinpath('dirC', 'dirD').exists())
2120 self.assertFalse(base.joinpath('dirC', 'dirD', 'fileD').exists())
2121 self.assertFalse(base.joinpath('dirC', 'fileC').exists())
2122 self.assertFalse(base.joinpath('dirC', 'novel.txt').exists())
2123
2124 def test_delete_missing(self):
2125 tmp = self.cls(self.base, 'delete')

Callers

nothing calls this directly

Calls 5

assertFalseMethod · 0.80
clsMethod · 0.45
_deleteMethod · 0.45
joinpathMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected