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_scroller_when_reversed(self): s = scroller.scroller(self.test_str, count=len(self.test_str), rev=True) e = self.test_str for a in s: e = scroller.permute(e, rev=True) self.assertEqual(a, e)
def test_scroller_when_reversed(self): s = scroller.scroller( self.test_str, count=len(self.test_str), rev=True ) e = self.test_str for a in s: e = scroller.permute(e, rev=True) self.assertEqual(a, e)
def test_scroller(self): s = scroller.scroller(self.test_str, count=len(self.test_str)) e = self.test_str for a in s: e = scroller.permute(e) self.assertEqual(a, e)
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)
def test_reverse(self, mock_print, mock_sleep): args = scroller.parser.parse_args(['-c', '1', '-s', '', '-r']) scroller.main(self.test_str, args) (calling_args,), _ = mock_print.call_args p = scroller.permute(self.test_str, rev=True) self.assertEqual(calling_args, p)
def test_permute(self): string = scroller.permute(self.test_str) self.assertEqual(string, self.test_str_permuted) string = scroller.permute(string, rev=True) self.assertEqual(string, self.test_str)