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.
This commit is contained in:
Barney Gale 2023-07-01 12:58:30 +01:00 committed by GitHub
parent 3fd99b5a97
commit 6e01055e15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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())