예제 #1
0
def test_extract_charge_resolution(tmpdir):
    output_path = os.path.join(str(tmpdir), "cr.h5")
    tool = ChargeResolutionGenerator()
    with pytest.raises(KeyError):
        tool.run([
            '-f', get_dataset_path("gamma_test_large.simtel.gz"),
            '-o', output_path,
        ])
예제 #2
0
def test_extract_charge_resolution(tmpdir):
    from ctapipe.tools.extract_charge_resolution import (
        ChargeResolutionGenerator
    )

    output_path = os.path.join(str(tmpdir), "cr.h5")
    tool = ChargeResolutionGenerator()
    with pytest.raises(KeyError):
        tool.run([
            '-f', get_dataset_path("gamma_test_large.simtel.gz"),
            '-o', output_path,
        ])
예제 #3
0
def test_extract_charge_resolution(tmpdir):
    from ctapipe.tools.extract_charge_resolution import (
        ChargeResolutionGenerator)

    output_path = os.path.join(str(tmpdir), "cr.h5")
    tool = ChargeResolutionGenerator()
    with pytest.raises(KeyError):
        tool.run([
            '-f',
            GAMMA_TEST_LARGE,
            '-o',
            output_path,
        ])
예제 #4
0
def test_extract_charge_resolution(tmpdir):
    from ctapipe.tools.extract_charge_resolution import (
        ChargeResolutionGenerator
    )

    output_path = os.path.join(str(tmpdir), "cr.h5")
    tool = ChargeResolutionGenerator()
    with pytest.raises(KeyError):
        tool.run([
            '-f', GAMMA_TEST_LARGE,
            '-O', output_path,
        ])
    # TODO: Test files do not contain true charge, cannot test tool fully
    # assert os.path.exists(output_path)

    with pytest.raises(SystemExit):
        tool.run(['--help-all'])
예제 #5
0
def test_extract_charge_resolution(tmpdir):
    from ctapipe.tools.extract_charge_resolution import ChargeResolutionGenerator

    output_path = os.path.join(str(tmpdir), "cr.h5")
    tool = ChargeResolutionGenerator()
    assert run_tool(tool, ["-f", GAMMA_TEST_LARGE, "-O", output_path]) == 1
    # TODO: Test files do not contain true charge, cannot test tool fully
    # assert os.path.exists(output_path)
    assert run_tool(tool, ["--help-all"]) == 0
예제 #6
0
def test_extract_charge_resolution(tmpdir):
    from ctapipe.tools.extract_charge_resolution import (
        ChargeResolutionGenerator
    )

    output_path = os.path.join(str(tmpdir), "cr.h5")
    tool = ChargeResolutionGenerator()
    with pytest.raises(KeyError):
        tool.run([
            '-f', GAMMA_TEST_LARGE,
            '-O', output_path,
        ])
    # TODO: Test files do not contain true charge, cannot test tool fully
    # assert os.path.exists(output_path)

    with pytest.raises(SystemExit):
        tool.run(['--help-all'])