def test_display_dl1(tmpdir, dl1_image_file, dl1_parameters_file): from ctapipe.tools.display_dl1 import DisplayDL1Calib mpl.use("Agg") # test simtel assert ( run_tool( DisplayDL1Calib(), argv=shlex.split("--max_events=1 " "--telescope=11 "), cwd=tmpdir, ) == 0 ) # test DL1A assert ( run_tool( DisplayDL1Calib(), argv=shlex.split( f"--input {dl1_image_file} --max_events=1 " "--telescope=11 " ), ) == 0 ) # test DL1B assert ( run_tool( DisplayDL1Calib(), argv=shlex.split( f"--input {dl1_parameters_file} --max_events=1 " "--telescope=11 " ), ) == 1 ) assert run_tool(DisplayDL1Calib(), ["--help-all"]) == 0
def test_display_dl1(tmp_path, dl1_image_file, dl1_parameters_file): from ctapipe.tools.display_dl1 import DisplayDL1Calib mpl.use("Agg") # test simtel assert ( run_tool( DisplayDL1Calib(), argv=["--max-events=1", "--telescope=11"], cwd=tmp_path ) == 0 ) # test DL1A assert ( run_tool( DisplayDL1Calib(), argv=[f"--input={dl1_image_file}", "--max-events=1", "--telescope=11"], ) == 0 ) # test DL1B, should error since nothing to plot ret = run_tool( DisplayDL1Calib(), argv=[f"--input={dl1_parameters_file}", "--max-events=1", "--telescope=11"], ) assert ret == 1 assert run_tool(DisplayDL1Calib(), ["--help-all"]) == 0
def test_display_dl1(tmpdir): from ctapipe.tools.display_dl1 import DisplayDL1Calib mpl.use("Agg") assert run_tool(DisplayDL1Calib(), argv=shlex.split("--max_events=1 " "--telescope=11 ")) == 0 assert run_tool(DisplayDL1Calib(), ["--help-all"]) == 0
def test_display_dl1(tmpdir): from ctapipe.tools.display_dl1 import DisplayDL1Calib mpl.use('Agg') tool = DisplayDL1Calib() tool.run(argv=shlex.split('--max_events=1 ' '--telescope=11 ')) with pytest.raises(SystemExit): tool.run(['--help-all'])
def test_display_dl1(tmpdir): from ctapipe.tools.display_dl1 import DisplayDL1Calib mpl.use('Agg') DisplayDL1Calib().run(argv=shlex.split('--max_events=1 ' '--telescope=11 '))