Skip to content

Commit 6e01055

Browse files
authored
GH-89812: Test that pathlib.Path.is_junction() returns false (GH-106062)
Slightly expand the test coverage of `is_junction()`. The existing test only checks that `os.path.isjunction()` is called under-the-hood.
1 parent 3fd99b5 commit 6e01055

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Lib/test/test_pathlib.py

+9
Original file line numberDiff line numberDiff line change
@@ -2271,6 +2271,15 @@ def test_is_symlink(self):
22712271
self.assertIs((P / 'linkA\udfff').is_file(), False)
22722272
self.assertIs((P / 'linkA\x00').is_file(), False)
22732273

2274+
def test_is_junction_false(self):
2275+
P = self.cls(BASE)
2276+
self.assertFalse((P / 'fileA').is_junction())
2277+
self.assertFalse((P / 'dirA').is_junction())
2278+
self.assertFalse((P / 'non-existing').is_junction())
2279+
self.assertFalse((P / 'fileA' / 'bah').is_junction())
2280+
self.assertFalse((P / 'fileA\udfff').is_junction())
2281+
self.assertFalse((P / 'fileA\x00').is_junction())
2282+
22742283
def test_is_fifo_false(self):
22752284
P = self.cls(BASE)
22762285
self.assertFalse((P / 'fileA').is_fifo())

0 commit comments

Comments
 (0)