Beispiel #1
0
def test_camdemo():
    sys.argv = ['camera_demo']
    tool = CameraDemo()
    tool.num_events = 10
    tool.cleanframes = 2
    tool.display = False
    tool.run(argv=[])
Beispiel #2
0
def test_camdemo():
    from ctapipe.tools.camdemo import CameraDemo
    sys.argv = ['camera_demo']
    tool = CameraDemo()
    tool.num_events = 10
    tool.cleanframes = 2
    tool.display = False
    tool.run(argv=[])
Beispiel #3
0
def test_camdemo():
    from ctapipe.tools.camdemo import CameraDemo
    sys.argv = ['camera_demo']
    tool = CameraDemo()
    tool.num_events = 10
    tool.cleanframes = 2
    tool.display = False
    tool.run(argv=[])

    with pytest.raises(SystemExit):
        tool.run(['--help-all'])
Beispiel #4
0
def test_camdemo(tmpdir):
    from ctapipe.tools.camdemo import CameraDemo

    sys.argv = ["camera_demo"]
    tool = CameraDemo()
    tool.num_events = 10
    tool.cleanframes = 2
    tool.display = False

    assert run_tool(tool, cwd=tmpdir) == 0
    assert run_tool(tool, ["--help-all"]) == 0
Beispiel #5
0
def test_camdemo():
    from ctapipe.tools.camdemo import CameraDemo
    sys.argv = ['camera_demo']
    tool = CameraDemo()
    tool.num_events = 10
    tool.cleanframes = 2
    tool.display = False
    tool.run(argv=[])

    with pytest.raises(SystemExit):
        tool.run(['--help-all'])
Beispiel #6
0
def test_export_config_to_yaml():
    """ test that we can export a Tool's config to YAML"""
    import yaml
    from ctapipe.tools.camdemo import CameraDemo

    tool = CameraDemo()
    tool.num_events = 2
    yaml_string = export_tool_config_to_commented_yaml(tool)

    # check round-trip back from yaml:
    config_dict = yaml.load(yaml_string, Loader=yaml.SafeLoader)

    assert config_dict["CameraDemo"]["num_events"] == 2
Beispiel #7
0
def test_camdemo():
    tool = CameraDemo()
    tool.num_events = 10
    tool.cleanframes = 2
    tool.display = False
    tool.run(argv=[])