Exemplo n.º 1
0
 def test_validate__negative_start(self):
     """ Test TimeSpan.validate with an initial time < 0. """
     test_tspan = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
     tspan = TimeSpan(test_tspan)
     with self.assertRaises(TimespanError):
         tspan.items = [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
         tspan.validate()
Exemplo n.º 2
0
 def test_validate__non_uniform_timespan(self):
     """ Test TimeSpan.validate with a non-uniform timespan. """
     test_tspan = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
     tspan = TimeSpan(test_tspan)
     with self.assertRaises(TimespanError):
         tspan.items = [2, 1, 3, 4, 5, 6, 7, 8, 9, 10]
         tspan.validate()
Exemplo n.º 3
0
 def test_validate__all_same_values(self):
     """ Test TimeSpan.validate with an empty data structure. """
     test_tspan = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
     tspan = TimeSpan(test_tspan)
     with self.assertRaises(TimespanError):
         tspan.items = [2, 2, 2, 2, 2, 2, 2, 2, 2]
         tspan.validate()