@@ -2496,9 +2496,10 @@ def test_get_source_tarball_from_git(self):
24962496 target_dir = os .path .join (self .test_prefix , 'target' )
24972497
24982498 try :
2499- ft .get_source_tarball_from_git ('test.tar.gz' , target_dir , git_config )
2499+ res = ft .get_source_tarball_from_git ('test.tar.gz' , target_dir , git_config )
25002500 # (only) tarball is created in specified target dir
25012501 test_file = os .path .join (target_dir , 'test.tar.gz' )
2502+ self .assertEqual (res , test_file )
25022503 self .assertTrue (os .path .isfile (test_file ))
25032504 self .assertEqual (os .listdir (target_dir ), ['test.tar.gz' ])
25042505
@@ -2509,8 +2510,10 @@ def test_get_source_tarball_from_git(self):
25092510
25102511 del git_config ['tag' ]
25112512 git_config ['commit' ] = '8456f86'
2512- ft .get_source_tarball_from_git ('test2.tar.gz' , target_dir , git_config )
2513- self .assertTrue (os .path .isfile (os .path .join (target_dir , 'test2.tar.gz' )))
2513+ res = ft .get_source_tarball_from_git ('test2.tar.gz' , target_dir , git_config )
2514+ test_file = os .path .join (target_dir , 'test2.tar.gz' )
2515+ self .assertEqual (res , test_file )
2516+ self .assertTrue (os .path .isfile (test_file ))
25142517 self .assertEqual (sorted (os .listdir (target_dir )), ['test.tar.gz' , 'test2.tar.gz' ])
25152518
25162519 except EasyBuildError as err :
@@ -2559,13 +2562,10 @@ def test_get_source_tarball_from_git(self):
25592562
25602563 def run_check ():
25612564 """Helper function to run get_source_tarball_from_git & check dry run output"""
2562- self .mock_stdout (True )
2563- self .mock_stderr (True )
2564- res = ft .get_source_tarball_from_git ('test.tar.gz' , target_dir , git_config )
2565- stdout = self .get_stdout ()
2566- stderr = self .get_stderr ()
2567- self .mock_stdout (False )
2568- self .mock_stderr (False )
2565+ with self .mocked_stdout_stderr ():
2566+ res = ft .get_source_tarball_from_git ('test.tar.gz' , target_dir , git_config )
2567+ stdout = self .get_stdout ()
2568+ stderr = self .get_stderr ()
25692569 self .assertEqual (stderr , '' )
25702570 regex = re .compile (expected )
25712571 self .assertTrue (regex .search (stdout ), "Pattern '%s' found in: %s" % (regex .pattern , stdout ))
0 commit comments