]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-89812: Test that `pathlib.Path.is_junction()` returns false (GH-106062)
authorBarney Gale <barney.gale@gmail.com>
Sat, 1 Jul 2023 11:58:30 +0000 (12:58 +0100)
committerGitHub <noreply@github.com>
Sat, 1 Jul 2023 11:58:30 +0000 (12:58 +0100)
Slightly expand the test coverage of `is_junction()`. The existing test
only checks that `os.path.isjunction()` is called under-the-hood.

Lib/test/test_pathlib.py

index a87f6c4cdc3daad1909c0a62a54e6b340c1ce7de..441a7bcd4d419974b618385924aa81f58dbcb2a9 100644 (file)
@@ -2271,6 +2271,15 @@ class PathTest(unittest.TestCase):
             self.assertIs((P / 'linkA\udfff').is_file(), False)
             self.assertIs((P / 'linkA\x00').is_file(), False)
 
+    def test_is_junction_false(self):
+        P = self.cls(BASE)
+        self.assertFalse((P / 'fileA').is_junction())
+        self.assertFalse((P / 'dirA').is_junction())
+        self.assertFalse((P / 'non-existing').is_junction())
+        self.assertFalse((P / 'fileA' / 'bah').is_junction())
+        self.assertFalse((P / 'fileA\udfff').is_junction())
+        self.assertFalse((P / 'fileA\x00').is_junction())
+
     def test_is_fifo_false(self):
         P = self.cls(BASE)
         self.assertFalse((P / 'fileA').is_fifo())