Skip to content

Commit

Permalink
Added fix to ignore scratch directory if it is within the output dire…
Browse files Browse the repository at this point in the history
…ctory for RTC-S1 output validation
  • Loading branch information
Scott Collins committed Nov 17, 2022
1 parent a82f3ad commit a96d61c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/opera/pge/rtc_s1/rtc_s1_pge.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ def _validate_output(self):
"""
out_dir_walk_dict = {}

output_dir = self.runconfig.output_product_path
output_dir = os.path.abspath(self.runconfig.output_product_path)
scratch_dir = os.path.abspath(self.runconfig.scratch_path)

# from 'output_dir' make a dictionary of {sub_dir_name: [file1, file2,...]}
for path, dirs, files in walk(output_dir):
if not dirs: # Ignore files in 'output_dir'
if not dirs and scratch_dir not in path: # Ignore files in 'output_dir' and scratch directory
out_dir_walk_dict[basename(path)] = files

output_format = self.runconfig.sas_config['runconfig']['groups']['product_path_group']['output_format']
Expand Down
2 changes: 1 addition & 1 deletion src/opera/test/pge/rtc_s1/test_rtc_s1_pge.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def test_rtc_s1_pge_output_validation_empty_dir(self):
log_contents = infile.read()

self.assertIn(
f"Empty SAS output directory: {output_dir}",
f"Empty SAS output directory: {os.path.abspath(output_dir)}",
log_contents
)
finally:
Expand Down

0 comments on commit a96d61c

Please sign in to comment.