def test_check_inputValidity_wrongOut():
    error = False
    try:
        Analysis = emf.SingleRunAnalysis(simulationFile, simulationTruth, 5)
        Analysis.check_inputValidity()
    except (ValueError, TypeError):
        error = True
    assert error == True
def test_analysis_main():
    Analysis = emf.SingleRunAnalysis(simulationFile, simulationTruth,
                                     output_dir)
    Analysis.analysis_main()
    wild_card_path = os.path.join(output_dir, "*")
    i = 0
    for path in glob.glob(wild_card_path):
        i += 1
    assert i == 2
def test_check_inputValidity_wrongSimTruth():
    error = False
    try:
        Analysis = emf.SingleRunAnalysis(simulationFile, "/foo/bar",
                                         output_dir)
        Analysis.check_inputValidity()
    except ValueError:
        error = True
    assert error == True
def test_check_inputValidity_allCorrect():
    error = False
    try:
        Analysis = emf.SingleRunAnalysis(simulationFile, simulationTruth,
                                         output_dir)
        Analysis.check_inputValidity()
    except ValueError:
        error = True
    assert error == False
def test_extract_muons_from_run():
    Analysis = emf.SingleRunAnalysis(simulationFile, simulationTruth,
                                     output_dir)
    Analysis.extract_muons_from_run()
    muonsPath = os.path.join(output_dir, "extracted_muons.csv")
    assert os.path.exists(muonsPath)
def test_create_output_dir():
    Analysis = emf.SingleRunAnalysis(simulationFile, simulationTruth,
                                     output_dir)
    Analysis.create_output_dir()
    assert os.path.isdir(output_dir)