def test_shift_loop(self): a = graph.Tick((0,4), (False, True)) b = graph.Tick((0,10,5), (False, True, False)) actual = a << b expected = graph.Tick((0,10,5, 4), (False, True, False, True)) self.assertEquals(actual, expected)
def test_repr_shift_loop(self): t = graph.Tick((0,10,4), (False, True, False)) self.assertEqual("(*10, 4)", repr(t))
def test_repr_noshift_loop(self): t = graph.Tick((0,4), (False, True)) self.assertEqual("*4", repr(t))
def test_loop_elements(self): t = graph.Tick((0,10,5,3), (False, True, False, True)) self.assertEquals((10, 3), t.loop_elements)
def test_mark_loop_iteration(self): t = graph.Tick((0,10,5), (False, False, False)) actual = t.mark_loop_iteration() expected = graph.Tick((0,10,5), (False, False, True)) self.assertEquals(actual, expected)
def test_shift(self): a = graph.Tick((0,1), (False, False)) b = graph.Tick((0,2), (False, False)) actual = a << b expected = graph.Tick((0,2,1), (False, False, False)) self.assertEquals(actual, expected)
def test_inc_loop(self): t = graph.Tick((0,4), (False, True)) t += 10 expected = graph.Tick((0,14), (False, True)) self.assertEqual(t, expected)
def test_parse_str_loop(self): expected = graph.Tick((0,1,2,3), (False, False, True, False)) actual = graph.Tick.parse_tick("1,*2,3") self.assertEquals(actual, expected)