Skip to content

Commit 1b3267c

Browse files
Restore mistakenly removed test_isfile_driveletter.
1 parent fe81ba8 commit 1b3267c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Lib/test/test_ntpath.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,13 @@ def test_isfile_invalid_paths(self):
12481248
self.assertIs(ntpath.isfile('/tmp\x00abcds'), False)
12491249
self.assertIs(ntpath.isfile(b'/tmp\x00abcds'), False)
12501250

1251+
@unittest.skipIf(sys.platform != 'win32', "drive letters are a windows concept")
1252+
def test_isfile_driveletter(self):
1253+
drive = os.environ.get('SystemDrive')
1254+
if drive is None or len(drive) != 2 or drive[1] != ':':
1255+
raise unittest.SkipTest('SystemDrive is not defined or malformed')
1256+
self.assertFalse(os.path.isfile('\\\\.\\' + drive))
1257+
12511258
@unittest.skipUnless(hasattr(os, 'pipe'), "need os.pipe()")
12521259
def test_isfile_anonymous_pipe(self):
12531260
pr, pw = os.pipe()

0 commit comments

Comments
 (0)