From 398149cb0769521dce8d77f94df8d6794c879989 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Fri, 2 Jun 2017 20:03:30 +0200 Subject: [PATCH] enhance test for copy_file to check for gracefully handling copying file to itself --- test/framework/filetools.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/framework/filetools.py b/test/framework/filetools.py index eda2f5ed2f..ea0c875a93 100644 --- a/test/framework/filetools.py +++ b/test/framework/filetools.py @@ -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,