Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Expand tests
  • Loading branch information
barneygale committed Aug 12, 2024
commit c5a79d043e7a69ec23a637c66e70ece8ccc091f6
21 changes: 21 additions & 0 deletions Lib/test/test_pathlib/test_pathlib_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,12 @@ def test_copy_symlink_follow_symlinks_false(self):
self.assertTrue(target.is_symlink())
self.assertEqual(source.readlink(), target.readlink())

@needs_symlinks
def test_copy_symlink_to_itself(self):
base = self.cls(self.base)
source = base / 'linkA'
self.assertRaises(OSError, source.copy, source)

@needs_symlinks
def test_copy_directory_symlink_follow_symlinks_false(self):
base = self.cls(self.base)
Expand All @@ -1769,6 +1775,20 @@ def test_copy_directory_symlink_follow_symlinks_false(self):
self.assertTrue(target.is_symlink())
self.assertEqual(source.readlink(), target.readlink())

@needs_symlinks
def test_copy_directory_symlink_to_itself(self):
base = self.cls(self.base)
source = base / 'linkB'
self.assertRaises(OSError, source.copy, source)
Comment thread
barneygale marked this conversation as resolved.

@needs_symlinks
def test_copy_directory_symlink_into_itself(self):
base = self.cls(self.base)
source = base / 'linkB'
/ 'linkB' / 'copyB'
self.assertRaises(OSError, source.copy, target)
Comment thread
barneygale marked this conversation as resolved.
self.assertFalse(target.exists())

def test_copy_file_to_existing_file(self):
base = self.cls(self.base)
source = base / 'fileA'
Expand Down Expand Up @@ -1933,6 +1953,7 @@ def test_copy_dir_into_itself(self):
source = base / 'dirC'
/ 'dirC' / 'dirD' / 'copyC'
self.assertRaises(OSError, source.copy, target)
Comment thread
barneygale marked this conversation as resolved.
self.assertFalse(target.exists())

def test_copy_missing_on_error(self):
base = self.cls(self.base)
Expand Down