Skip to content

Commit

Permalink
Check the downloaded file
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx committed Jan 31, 2024
1 parent 828c954 commit 176e08b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions tests/test_FullChain.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def setUpClass(cls):
downloader = straxen.MongoDownloader(store_files_at=(cls.temp_dir.name,))
downloader.download_single(test_root_file_name, human_readable_file_name=True)

assert os.path.exists(os.path.join(cls.temp_dir.name, test_root_file_name))

cls.test_context = fuse.context.full_chain_context(output_folder = cls.temp_dir.name)

cls.test_context.set_config({"path": cls.temp_dir.name,
Expand Down
2 changes: 2 additions & 0 deletions tests/test_MicroPhysics.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def setUpClass(cls):
downloader = straxen.MongoDownloader(store_files_at=(cls.temp_dir.name,))
downloader.download_single(test_root_file_name, human_readable_file_name=True)

assert os.path.exists(os.path.join(cls.temp_dir.name, test_root_file_name))

cls.test_context = fuse.context.microphysics_context(cls.temp_dir.name)

cls.test_context.set_config({"path": cls.temp_dir.name,
Expand Down
8 changes: 5 additions & 3 deletions tests/test_deterministic_seed.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import unittest
import tempfile
import numpy as np
import fuse
import straxen
from numpy.testing import assert_array_equal, assert_raises
Expand All @@ -14,8 +14,10 @@ def setUp(self):
self.temp_dir_0 = tempfile.TemporaryDirectory()
self.temp_dir_1 = tempfile.TemporaryDirectory()

downloader = straxen.MongoDownloader(store_files_at=(self.temp_dir_0.name,))
downloader.download_single(test_root_file_name, human_readable_file_name=True)
for temp_dir in [self.temp_dir_0, self.temp_dir_1]:
downloader = straxen.MongoDownloader(store_files_at=(temp_dir.name,))
downloader.download_single(test_root_file_name, human_readable_file_name=True)
assert os.path.exists(os.path.join(temp_dir.name, test_root_file_name))

self.test_context_0 = fuse.context.full_chain_context(output_folder = self.temp_dir_0.name)

Expand Down

0 comments on commit 176e08b

Please sign in to comment.