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

Method test_current_directory

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

Source from the content-addressed store, hash-verified

5201 return self.get_entry(os.path.basename(filename))
5202
5203 def test_current_directory(self):
5204 filename = self.create_file()
5205 old_dir = os.getcwd()
5206 try:
5207 os.chdir(self.path)
5208
5209 # call scandir() without parameter: it must list the content
5210 # of the current directory
5211 entries = dict((entry.name, entry) for entry in os.scandir())
5212 self.assertEqual(sorted(entries.keys()),
5213 [os.path.basename(filename)])
5214 finally:
5215 os.chdir(old_dir)
5216
5217 def test_repr(self):
5218 entry = self.create_file_entry()

Callers

nothing calls this directly

Calls 6

create_fileMethod · 0.95
sortedFunction · 0.85
basenameMethod · 0.80
scandirMethod · 0.45
assertEqualMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected