Skip to content

Commit 39d84b6

Browse files
committed
adapt tests
1 parent 1fa8f6f commit 39d84b6

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

src/osa/conftest.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from osa.scripts.tests.test_osa_scripts import run_program
2727
from osa.utils.utils import date_to_dir
2828
from datetime import datetime
29-
import lstchain
3029

3130
date = datetime.fromisoformat("2020-01-17")
3231
nightdir = date_to_dir(date)
@@ -87,14 +86,14 @@ def drive_log(monitoring_dir):
8786

8887
@pytest.fixture(scope="session")
8988
def calibration_dir(calibration_base_dir):
90-
directory = calibration_base_dir / "calibration" / nightdir / f"v{lstchain.__version__}"
89+
directory = calibration_base_dir / "calibration" / nightdir / f"v0.1.1"
9190
directory.mkdir(parents=True, exist_ok=True)
9291
return directory
9392

9493

9594
@pytest.fixture(scope="session")
9695
def drs4_baseline_dir(calibration_base_dir):
97-
directory = calibration_base_dir / "drs4_baseline" / nightdir / f"v{lstchain.__version__}"
96+
directory = calibration_base_dir / "drs4_baseline" / nightdir / f"v0.1.1"
9897
directory.mkdir(parents=True, exist_ok=True)
9998
return directory
10099

src/osa/high_level/significance.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ def main(
206206
log.debug(f"Config: {config.resolve()}")
207207

208208
# Initial setup of global parameters
209+
if simulate:
210+
options.simulate = True
209211
options.date = date
210212
flat_date = date_to_dir(date)
211213
options.tel_id = telescope

src/osa/nightsummary/tests/test_extract.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from datetime import datetime
2+
from osa.configs import options
23

4+
options.test = True
35
obs_date = datetime.fromisoformat("2020-01-17")
46

57

src/osa/scripts/tests/test_osa_scripts.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,6 @@ def test_drs4_pedestal_cmd(base_test_dir):
350350
base_test_dir,
351351
f"--r0-dir={r0_dir}",
352352
"--no-progress",
353-
"-v","v0.11.0.post1"
354-
355353
]
356354
assert cmd == expected_command
357355

@@ -370,7 +368,6 @@ def test_calibration_file_cmd(base_test_dir):
370368
"-b",
371369
base_test_dir,
372370
f"--r0-dir={r0_dir}",
373-
"-v","v0.11.0.post1"
374371
]
375372
assert cmd == expected_command
376373

src/osa/utils/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,8 @@ def get_RF_model(run_id: int) -> Path:
407407

408408
def get_lstcam_calib_version(env_path: Path) -> str:
409409
"""Get the version of the lstcam_calib package installed in the given environment."""
410+
if options.test or options.simulate:
411+
return "0.1.1"
410412
python_exe = f"{str(env_path)}/bin/python"
411413
cmd = [python_exe, "-m", "pip", "show", "lstcam_calib"]
412414
result = sp.run(cmd, capture_output=True, text=True, check=True)

0 commit comments

Comments
 (0)