00001 00002 from nose.tools import raises 00003 from DybDbi import GCalibPmtSpec, GSimPmtSpec 00004 from mapper import Mapper 00005 00006 ckf = ['status', '_srcline', 'afterPulse', 'sigmaSpe', 'pmtID', 'efficiency', 'darkRate', '_hasblank', 'prePulse', 'speLow', 'timeOffset', 'timeSpread', 'speHigh', 'description'] 00007 00008 def setup(): 00009 pass 00010 00011 def teardown(): 00012 pass 00013 00014 00015 def test_peachy(): 00016 mpr = Mapper( GCalibPmtSpec, ckf , afterPulse="AfterPulseProb", sigmaSpe="SigmaSpeHigh", prePulse="PrePulseProb", description="Describ" ) 00017 assert mpr.is_valid() 00018 00019 @raises(Exception) 00020 def test_missing(): 00021 mpr = Mapper( GCalibPmtSpec, ckf , afterPulse="AfterPulseProb", sigmaSpe="SigmaSpeHigh", prePulse="PrePulseProb", ) 00022 00023 @raises(Exception) 00024 def test_accident(): 00025 mpr = Mapper( GSimPmtSpec, ckf , afterPulse="AfterPulseProb", sigmaSpe="SigmaSpeHigh", prePulse="PrePulseProb", ) 00026 00027 00028 00029 if __name__=='__main__': 00030 setup() 00031 test_peachy() 00032 test_missing() 00033 test_accident() 00034 teardown() 00035 00036