mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-99547: Add isjunction methods for checking if a path is a junction (GH-99548)
This commit is contained in:
parent
c2102136be
commit
1b2de89bce
15 changed files with 182 additions and 24 deletions
|
@ -2411,6 +2411,13 @@ class _BasePathTest(object):
|
|||
self.assertIs((P / 'linkA\udfff').is_file(), False)
|
||||
self.assertIs((P / 'linkA\x00').is_file(), False)
|
||||
|
||||
def test_is_junction(self):
|
||||
P = self.cls(BASE)
|
||||
|
||||
with mock.patch.object(P._flavour, 'pathmod'):
|
||||
self.assertEqual(P.is_junction(), P._flavour.pathmod.isjunction.return_value)
|
||||
P._flavour.pathmod.isjunction.assert_called_once_with(P)
|
||||
|
||||
def test_is_fifo_false(self):
|
||||
P = self.cls(BASE)
|
||||
self.assertFalse((P / 'fileA').is_fifo())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue