Skip to content

Commit

Permalink
Replicate full export_path generation
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahshi committed Feb 27, 2024
1 parent ff2ec60 commit 3a00c4a
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions UnitTests/test_fittingfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,22 @@ def test_MCMC_interp(self):

def test_MCMC_exportpath(self):

temp_export_path = "temp_test_dir"
figures_path = os.path.join("FIGURES", temp_export_path)
os.makedirs(figures_path, exist_ok=True)
path_beg = os.getcwd() + "/"
temp_export_path = os.path.join(path_beg, "temp_test_dir")
output_dirs = [
"FIGURES",
"PLOTFILES",
"NPZTXTFILES",
"LOGFILES",
"BLPEAKFILES",
"PKLFILES",
]
paths = {}
for dir_name in output_dirs:
full_path = os.path.join(temp_export_path, dir_name)
paths[dir_name] = full_path
os.makedirs(full_path, exist_ok=True)
fpath = paths["FIGURES"]

Volatiles_DF, _ = pig.calculate_baselines(
self.dfs_dict, temp_export_path)
Expand All @@ -203,7 +216,7 @@ def test_MCMC_exportpath(self):
temp_export_path,
"output.csv")))

figure_files = glob.glob(os.path.join(figures_path, "*.pdf"))
figure_files = glob.glob(os.path.join(fpath, "*.pdf"))
self.assertTrue(len(figure_files) > 0, "No figure files found in the FIGURES subdirectory.")

# Cleanup
Expand Down

0 comments on commit 3a00c4a

Please sign in to comment.