00001 00002 import os 00003 from DybDbi import GCalibPmtSpec, GSimPmtSpec 00004 from csv_tools import csv_import 00005 from nose.tools import raises 00006 00007 os.environ['DBCONF'] = "tmp_offline_db" 00008 00009 00010 def test_peachy(): 00011 path = "$DBWRITERROOT/share/DYB_MC_AD1.txt" 00012 csv_import( GCalibPmtSpec , path , afterPulse="AfterPulseProb", sigmaSpe="SigmaSpeHigh", prePulse="PrePulseProb", description="Describ" ) 00013 00014 @raises(Exception) 00015 def test_mismap(): 00016 path = "$DBWRITERROOT/share/DYB_MC_AD1.txt" 00017 csv_import( GCalibPmtSpec , path , afterPulse="AfterPulseProb", sigmaSpe="SigmaSpeHigh", prePulse="PrePulseProb", ) 00018 00019 @raises(Exception) 00020 def test_invalid(): 00021 path = "$DBWRITERROOT/share/DYB_SAB_AD1.txt" 00022 csv_import( GCalibPmtSpec , path , afterPulse="AfterPulseProb", sigmaSpe="SigmaSpeHigh", prePulse="PrePulseProb", description="Describ") 00023 00024 @raises(Exception) 00025 def test_accident(): 00026 path = "$DBWRITERROOT/share/DYB_SAB_AD1.txt" 00027 csv_import( GSimPmtSpec , path , afterPulse="AfterPulseProb", sigmaSpe="SigmaSpeHigh", prePulse="PrePulseProb", description="Describ" ) 00028 00029 00030 00031 if __name__=='__main__': 00032 pass 00033 test_peachy() 00034 test_mismap() 00035 test_invalid() 00036 test_accident() 00037