How to use the termgraph.termgraph.print_categories function in termgraph

To help you get started, we’ve selected a few termgraph examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mkaz / termgraph / tests / test_termgraph.py View on Github external
def test_print_categories_prints_correct_categories(self):
        with patch('sys.stdout', new=StringIO()) as output:
            categories = ['Boys', 'Girls']
            colors = [91, 94]
            tg.print_categories(categories, colors)
            output = output.getvalue().strip()
            assert output == "\x1b[91m▇ Boys  \x1b[0m\x1b[94m▇ Girls  \x1b[0m"