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

Method test_mkdir

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

Source from the content-addressed store, hash-verified

2358 self.assertEqual(f.read().strip(), b"this is file A")
2359
2360 def test_mkdir(self):
2361 P = self.cls(self.base)
2362 p = P / 'newdirA'
2363 self.assertFalse(p.exists())
2364 p.mkdir()
2365 self.assertTrue(p.exists())
2366 self.assertTrue(p.is_dir())
2367 with self.assertRaises(OSError) as cm:
2368 p.mkdir()
2369 self.assertEqual(cm.exception.errno, errno.EEXIST)
2370
2371 def test_mkdir_parents(self):
2372 # Creating a chain of directories.

Callers

nothing calls this directly

Calls 8

assertFalseMethod · 0.80
assertTrueMethod · 0.80
clsMethod · 0.45
existsMethod · 0.45
mkdirMethod · 0.45
is_dirMethod · 0.45
assertRaisesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected