Skip to content

Commit

Permalink
Merge pull request #1 from boegel/patch_copy_check_same
Browse files Browse the repository at this point in the history
enhance test for copy_file to check for gracefully handling copying file to itself
  • Loading branch information
vanzod authored Jun 2, 2017
2 parents 6d6942f + 398149c commit ad9ff9e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/framework/filetools.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,9 @@ def test_copy_file(self):
src, target = os.path.dirname(to_copy), os.path.join(self.test_prefix, 'toy')
self.assertErrorRegex(EasyBuildError, "Failed to copy file.*Is a directory", ft.copy_file, src, target)

# copying a file to its own location should fail, but nicely (i.e. with an EasyBuildError, not a traceback)
self.assertErrorRegex(EasyBuildError, "Failed to copy file", ft.copy_file, to_copy, to_copy)

# also test behaviour of copy_file under --dry-run
build_options = {
'extended_dry_run': True,
Expand Down

0 comments on commit ad9ff9e

Please sign in to comment.