Skip to content

Commit

Permalink
Rename mount data env variable and expand it
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmlft committed Jan 30, 2024
1 parent eaea84a commit 769c0ac
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pixl_core/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
os.environ["FTP_PORT"] = "20021"

TEST_DIR = Path(__file__).parent
DUMMY_SERVICES_DIR = Path(__file__).parents[2] / "test" / "dummy-services"
MOUNTED_DATA_DIR = (
Path(__file__).parents[2] / "test" / "dummy-services" / "ftp-server" / "mounts" / "data"
)
STUDY_DATE = datetime.date.fromisoformat("2023-01-01")


Expand Down Expand Up @@ -72,12 +74,8 @@ def mounted_data() -> Path:
The mounted data directory for the ftp server.
This will contain the data after successful upload.
"""
yield DUMMY_SERVICES_DIR / "ftp-server" / "mounts" / "data"
sub_dirs = [
f.path
for f in os.scandir(DUMMY_SERVICES_DIR / "ftp-server" / "mounts" / "data")
if f.is_dir()
]
yield MOUNTED_DATA_DIR
sub_dirs = [f.path for f in os.scandir(MOUNTED_DATA_DIR) if f.is_dir()]
# Tear down the directory after tests
for sub_dir in sub_dirs:
shutil.rmtree(sub_dir, ignore_errors=True)
Expand Down

0 comments on commit 769c0ac

Please sign in to comment.