def test_scroll_reverse(self): scrolled = scroller.scroll(self.test_str) test_length = len(self.test_str) - 1 for _ in range(test_length): string = next(scrolled) scrolled = scroller.scroll(string, rev=True) for _ in range(test_length): string = next(scrolled) self.assertEqual(string, self.test_str)
def test_scroll_separator_when_reversed(self): sep = ' ' scrolled = scroller.scroll(self.test_str, sep=sep, rev=True) string = self.test_str + sep for i in range(len(self.test_str)): string = scroller.permute(string, rev=True) self.assertEqual(next(scrolled), string)
def test_scroll_separator(self): sep = ' ' scrolled = scroller.scroll(self.test_str, sep=sep) string = self.test_str + sep for _ in range(len(self.test_str)): string = scroller.permute(string) self.assertEqual(next(scrolled), string)
def test_scroll_static_when_reversed(self): scrolled = scroller.scroll(self.test_str, static=True, rev=True) for i in range(len(self.test_str)): self.assertEqual(next(scrolled), self.test_str)
def test_scroll(self): scrolled = scroller.scroll(self.test_str) string = self.test_str for _ in range(len(self.test_str)): string = scroller.permute(string) self.assertEqual(next(scrolled), string)