summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ntpath.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_ntpath.py')
-rw-r--r--Lib/test/test_ntpath.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
index 7f91bf1..9aa1166 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -1095,6 +1095,27 @@ class TestNtpath(NtpathTestCase):
raise unittest.SkipTest('SystemDrive is not defined or malformed')
self.assertFalse(os.path.isfile('\\\\.\\' + drive))
+ @unittest.skipUnless(hasattr(os, 'pipe'), "need os.pipe()")
+ def test_isfile_anonymous_pipe(self):
+ pr, pw = os.pipe()
+ try:
+ self.assertFalse(ntpath.isfile(pr))
+ finally:
+ os.close(pr)
+ os.close(pw)
+
+ @unittest.skipIf(sys.platform != 'win32', "windows only")
+ def test_isfile_named_pipe(self):
+ import _winapi
+ named_pipe = f'//./PIPE/python_isfile_test_{os.getpid()}'
+ h = _winapi.CreateNamedPipe(named_pipe,
+ _winapi.PIPE_ACCESS_INBOUND,
+ 0, 1, 0, 0, 0, 0)
+ try:
+ self.assertFalse(ntpath.isfile(named_pipe))
+ finally:
+ _winapi.CloseHandle(h)
+
@unittest.skipIf(sys.platform != 'win32', "windows only")
def test_con_device(self):
self.assertFalse(os.path.isfile(r"\\.\CON"))
@@ -1114,8 +1135,12 @@ class TestNtpath(NtpathTestCase):
self.assertFalse(inspect.isfunction(os.path.isfile))
self.assertTrue(os.path.islink is nt._path_islink)
self.assertFalse(inspect.isfunction(os.path.islink))
+ self.assertTrue(os.path.isjunction is nt._path_isjunction)
+ self.assertFalse(inspect.isfunction(os.path.isjunction))
self.assertTrue(os.path.exists is nt._path_exists)
self.assertFalse(inspect.isfunction(os.path.exists))
+ self.assertTrue(os.path.lexists is nt._path_lexists)
+ self.assertFalse(inspect.isfunction(os.path.lexists))
@unittest.skipIf(os.name != 'nt', "Dev Drives only exist on Win32")
def test_isdevdrive(self):