def test_multiple_init_debug(recwarn): """ Ensure that warn is there for multiple init_debug() invocation. We already do init_debug() in __init__.py for testing purposes. """ smartcols.init_debug() assert len(recwarn) == 1 w = recwarn.pop(RuntimeWarning) assert issubclass(w.category, RuntimeWarning) assert str(w.message) == "Calling smartcols.init_debug() multiple times has no effect. First call initializes debugging features." assert w.filename assert w.lineno
add_line("bar", "alb alb alb") title = tb.title # right title.data = "This is right title" title.color = "red" title.position = "right" print(tb) # center sm = smartcols.Symbols() sm.title_padding = "=" tb.symbols = sm title.data = "This is center title (with padding)" title.color = "green" title.position = "center" print(tb) # left sm.title_padding = "-" title.data = "This is left title (with padding)" title.color = "blue" title.position = "left" print(tb) if __name__ == "__main__": locale.setlocale(locale.LC_ALL, "") smartcols.init_debug() main()
add_line("foo", "bla bla bla") add_line("bar", "alb alb alb") title = tb.title # right title.data = "This is right title" title.color = "red" title.position = "right" print(tb) # center sm = smartcols.Symbols() sm.title_padding = "=" tb.symbols = sm title.data = "This is center title (with padding)" title.color = "green" title.position = "center" print(tb) # left sm.title_padding = "-" title.data = "This is left title (with padding)" title.color = "blue" title.position = "left" print(tb) if __name__ == "__main__": locale.setlocale(locale.LC_ALL, "") smartcols.init_debug() main()