Skip to content

Commit

Permalink
enhance test for copy_file to check for gracefully handling copying f…
Browse files Browse the repository at this point in the history
…ile to itself
  • Loading branch information
boegel committed Jun 2, 2017
1 parent 6d6942f commit 398149c
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 398149c

Please sign in to comment.