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

Method test_devices

Lib/test/test_stat.py:209–220  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

207
208 @unittest.skipUnless(os.name == 'posix', 'requires Posix')
209 def test_devices(self):
210 if os.path.exists(os.devnull):
211 st_mode, modestr = self.get_mode(os.devnull, lstat=False)
212 self.assertEqual(modestr[0], 'c')
213 self.assertS_IS("CHR", st_mode)
214 # Linux block devices, BSD has no block devices anymore
215 for blockdev in ("/dev/sda", "/dev/hda"):
216 if os.path.exists(blockdev):
217 st_mode, modestr = self.get_mode(blockdev, lstat=False)
218 self.assertEqual(modestr[0], 'b')
219 self.assertS_IS("BLK", st_mode)
220 break
221
222 @socket_helper.skip_unless_bind_unix_socket
223 def test_socket(self):

Callers

nothing calls this directly

Calls 4

get_modeMethod · 0.95
assertS_ISMethod · 0.95
existsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected