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

Method test_current_directory

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

Source from the content-addressed store, hash-verified

4925 return self.get_entry(os.path.basename(filename))
4926
4927 def test_current_directory(self):
4928 filename = self.create_file()
4929 old_dir = os.getcwd()
4930 try:
4931 os.chdir(self.path)
4932
4933 # call scandir() without parameter: it must list the content
4934 # of the current directory
4935 entries = dict((entry.name, entry) for entry in os.scandir())
4936 self.assertEqual(sorted(entries.keys()),
4937 [os.path.basename(filename)])
4938 finally:
4939 os.chdir(old_dir)
4940
4941 def test_repr(self):
4942 entry = self.create_file_entry()

Callers

nothing calls this directly

Calls 5

create_fileMethod · 0.95
scandirMethod · 0.45
assertEqualMethod · 0.45
keysMethod · 0.45
basenameMethod · 0.45

Tested by

no test coverage detected