Unite tempest_dir in _get_next_stream_subunit_output_file

The method have used tempest_dir value given by the argument as well
as self.tempest_dir value which was confusing and lead to a unit test
failure in the case when tempest_dir was a valid path to an existing
tempest environment.

Usually self.tempest_dir and tempest_dir were the same, the values
were different only in a unittest which was editing the tempest dir
path for test purposes.

The docstring suggests that the method should use the value from the
argument, therefore the patch removes the self.tempest_dir occurrence.

Change-Id: I80dc38e6f0dcff1956f2881894d51a1c35577b33
This commit is contained in:
Martin Kopec 2020-12-14 15:29:46 +00:00
parent 8078ab8d76
commit f018caa06e

@ -136,9 +136,9 @@ class RefstackClient:
'''This method reads from the next-stream file in the .testrepository
or .stestr directory according to Tempest version of the given
Tempest path. The integer here is the name of the file where subunit
output will be saved to. It also check if the repository is
initialized and if not, initialize it'''
if os.path.exists(os.path.join(self.tempest_dir, '.stestr.conf')):
output will be saved to. It also checks if the repository is
initialized and if not, initializes it'''
if os.path.exists(os.path.join(tempest_dir, '.stestr.conf')):
sub_dir = '.stestr'
cmd = 'stestr'
else: