mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
bpo-30897: Add is_mount() to pathlib.Path (#2669)
* Add in is_mount() call to pathlib.Path similiar to os.path.ismount(path) * Add tests for is_mount()
This commit is contained in:
parent
9eef9e805e
commit
173ff4a58a
2 changed files with 36 additions and 0 deletions
|
@ -1880,6 +1880,18 @@ class _BasePathTest(object):
|
|||
self.assertFalse((P / 'linkB').is_file())
|
||||
self.assertFalse((P/ 'brokenLink').is_file())
|
||||
|
||||
@only_posix
|
||||
def test_is_mount(self):
|
||||
P = self.cls(BASE)
|
||||
R = self.cls('/') # TODO: Work out windows
|
||||
self.assertFalse((P / 'fileA').is_mount())
|
||||
self.assertFalse((P / 'dirA').is_mount())
|
||||
self.assertFalse((P / 'non-existing').is_mount())
|
||||
self.assertFalse((P / 'fileA' / 'bah').is_mount())
|
||||
self.assertTrue(R.is_mount())
|
||||
if support.can_symlink():
|
||||
self.assertFalse((P / 'linkA').is_mount())
|
||||
|
||||
def test_is_symlink(self):
|
||||
P = self.cls(BASE)
|
||||
self.assertFalse((P / 'fileA').is_symlink())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue