summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pathlib.py
diff options
context:
space:
mode:
authorCharles Machalow <csm10495@gmail.com>2022-11-22 17:19:34 (GMT)
committerGitHub <noreply@github.com>2022-11-22 17:19:34 (GMT)
commit1b2de89bce7eee3c63ce2286f071db57cd2cfa22 (patch)
tree34dfc872d34c8468edb2b7ef37cb89055097846e /Lib/test/test_pathlib.py
parentc2102136be569e6fc8ed90181f229b46d07142f8 (diff)
downloadcpython-1b2de89bce7eee3c63ce2286f071db57cd2cfa22.zip
cpython-1b2de89bce7eee3c63ce2286f071db57cd2cfa22.tar.gz
cpython-1b2de89bce7eee3c63ce2286f071db57cd2cfa22.tar.bz2
gh-99547: Add isjunction methods for checking if a path is a junction (GH-99548)
Diffstat (limited to 'Lib/test/test_pathlib.py')
-rw-r--r--Lib/test/test_pathlib.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
index 3b1f302..94401e5 100644
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
@@ -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())