MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_walk_named_pipe2

Method test_walk_named_pipe2

Lib/test/test_os.py:1687–1714  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1685 @unittest.skipIf(sys.platform == "vxworks",
1686 "fifo requires special path on VxWorks")
1687 def test_walk_named_pipe2(self):
1688 path = os_helper.TESTFN + '-dir'
1689 os.mkdir(path)
1690 self.addCleanup(shutil.rmtree, path)
1691 os.mkfifo(os.path.join(path, 'mypipe'))
1692
1693 errors = []
1694 walk_it = self.walk(path, onerror=errors.append)
1695 next(walk_it)
1696 self.assertRaises(StopIteration, next, walk_it)
1697 self.assertEqual(errors, [])
1698
1699 errors = []
1700 walk_it = self.walk(path, onerror=errors.append)
1701 root, dirs, files = next(walk_it)
1702 self.assertEqual(root, path)
1703 self.assertEqual(dirs, [])
1704 self.assertEqual(files, ['mypipe'])
1705 dirs.extend(files)
1706 files.clear()
1707 if self.is_fwalk:
1708 self.assertRaises(NotADirectoryError, next, walk_it)
1709 self.assertRaises(StopIteration, next, walk_it)
1710 if self.is_fwalk:
1711 self.assertEqual(errors, [])
1712 else:
1713 self.assertEqual(len(errors), 1, errors)
1714 self.assertIsInstance(errors[0], NotADirectoryError)
1715
1716 def test_walk_many_open_files(self):
1717 depth = 30

Callers

nothing calls this directly

Calls 11

walkMethod · 0.95
nextFunction · 0.85
lenFunction · 0.85
addCleanupMethod · 0.80
assertIsInstanceMethod · 0.80
mkdirMethod · 0.45
joinMethod · 0.45
assertRaisesMethod · 0.45
assertEqualMethod · 0.45
extendMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected