Example #1
0
 def test_center_after_upper_limit_should_make_period_end_there(self):
     tp = TimePeriod(ATimeType(), ATime(10), ATime(14))
     self.assertEquals(
         tp.center(ATime(200)),
         TimePeriod(ATimeType(), ATime(96), ATime(100)))
Example #2
0
 def test_center_before_lower_limit_should_make_period_start_there(self):
     tp = TimePeriod(ATimeType(), ATime(10), ATime(14))
     self.assertEquals(
         tp.center(ATime(-5)),
         TimePeriod(ATimeType(), ATime(0), ATime(4)))
Example #3
0
 def test_center_should_center_period_around_time(self):
     tp = TimePeriod(ATimeType(), ATime(0), ATime(4))
     self.assertEquals(
         tp.center(ATime(5)),
         TimePeriod(ATimeType(), ATime(3), ATime(7)))
Example #4
0
 def test_center_after_upper_limit_should_make_period_end_there(self):
     tp = TimePeriod(ATimeType(), ATime(10), ATime(14))
     self.assertEquals(tp.center(ATime(200)),
                       TimePeriod(ATimeType(), ATime(96), ATime(100)))
Example #5
0
 def test_center_before_lower_limit_should_make_period_start_there(self):
     tp = TimePeriod(ATimeType(), ATime(10), ATime(14))
     self.assertEquals(tp.center(ATime(-5)),
                       TimePeriod(ATimeType(), ATime(0), ATime(4)))
Example #6
0
 def test_center_should_center_period_around_time(self):
     tp = TimePeriod(ATimeType(), ATime(0), ATime(4))
     self.assertEquals(tp.center(ATime(5)),
                       TimePeriod(ATimeType(), ATime(3), ATime(7)))