Skip to content

Commit

Permalink
unit test for setup_pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurmloureiro committed Dec 5, 2023
1 parent dac5840 commit 1cd8e29
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/blind_2pt_cosmosis/cosmosis_files/params.ini
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ file = cosmosis-standard-library/boltzmann/camb/camb_interface.py
mode=all
lmax=2500
feedback=0
kmin=1e-5
;kmin=1e-5
kmax=10.0
nk=400

Expand Down
14 changes: 13 additions & 1 deletion tests/test_run_cosmosis_2pt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import pytest
from cosmosis.runtime.config import Inifile
from cosmosis.runtime.pipeline import LikelihoodPipeline
from blind_2pt_cosmosis.run_cosmosis_2pt import setup_pipeline, modify_settings, run_pipeline, run_cosmosis_togen_2ptdict

def test_modify_settings():
Expand Down Expand Up @@ -54,4 +56,14 @@ def __init__(self):

# Exercise and Verify
with pytest.raises(ValueError):
modify_settings(ini, None, nz_file)
modify_settings(ini, None, nz_file)

def test_setup_pipeline():
# Setup
inifile = './src/blind_2pt_cosmosis/cosmosis_files/default_blinding_template.ini'
angles_file = 'angles.fits'
nz_file = 'nz.fits'

# Exercise
pipeline = setup_pipeline(inifile)
assert isinstance(pipeline, LikelihoodPipeline)

0 comments on commit 1cd8e29

Please sign in to comment.