Commit 6ed53fec authored by Ambra Di Piano's avatar Ambra Di Piano
Browse files

missing tests

parent 5886b99f
Loading
Loading
Loading
Loading
+20 −4
Original line number Diff line number Diff line
@@ -168,9 +168,25 @@ def test_plot_map(test_conf_file, save):
        plotmap = plot_map(fitsmap, log)
        assert isfile(plotmap)

def test_set_irf():
    conf = {'array': 'lst', 'prod': 'prod5-v0.1', 'irf': 'random'}
@pytest.mark.test_conf_file
@pytest.mark.test_data_folder
@pytest.mark.test_tmp_folder
@pytest.mark.parametrize('replicate', [None, 'test_simulator.dat'])
def test_set_irf(test_conf_file, test_data_folder, replicate):
    conf = load_yaml_conf(test_conf_file)
    conf['simulator']['replicate'] = join(test_data_folder, replicate) if replicate is not None else replicate
    log = set_logger(logging.CRITICAL)
    irf = set_irf(conf, log)
    print(irf)
    assert conf['array'].upper() in irf

@pytest.mark.test_conf_file
@pytest.mark.test_data_folder
@pytest.mark.test_tmp_folder
@pytest.mark.parametrize('replicate', [None, 'test_simulator.dat'])
def test_set_pointing(test_conf_file, test_data_folder, replicate):
    conf = load_yaml_conf(test_conf_file)
    conf['simulator']['replicate'] = join(test_data_folder, replicate) if replicate is not None else replicate
    log = set_logger(logging.CRITICAL)
    sim = RTACtoolsSimulation()
    sim, point = set_pointing(sim, conf, log)
    assert type(sim.ra) == type(sim.dec) 
 No newline at end of file