Пример #1
0
 def setUp(self):
     v0 = dt.timedelta(0,3600,0)
     v1 = 'PT5H'
     dv = 'PT1H'
     cl ='open-closed'
     self.domain = AllowedRange(v0,v1,cl,spacing=dv,dtype=dt.timedelta)
     self.accepted = [Duration.parse('PT2H'),dt.timedelta(0,3*3600,0),
                     'PT4H', 'PT5H','PT2H0.000001S'] # tolerance: step*1e-9 
     self.rejected = ['PT30M','PT1H','PT2H30M',]
Пример #2
0
 def setUp(self):
     self.domain = AllowedRange('-P1DT1H', 'P1M0DT30M', dtype=Duration)
     self.accepted = [ Duration.parse('-P1DT1H'), 'P0D' , 'P1M0DT30M'] 
     self.rejected = [ Duration.parse('-P2D18H'), 'P1Y' ]
Пример #3
0
 def setUp(self):
     vlist = ['P1Y', 'P26DT1M', 'P25M16S']
     self.domain = AllowedEnum(vlist, dtype=dt.timedelta)
     self.accepted = [ vlist[1], Duration.parse(vlist[0]) ]
     self.rejected = [ Duration.parse('P7D15H8M') ]