Пример #1
0
    def test_print_heading_3(self, click):
        ConsolePrinter.print_heading(
            'Amet consectetur', ConsolePrinter.HEADING_LEVEL_THREE)

        assert click.secho.call_count == 2
        click.secho.assert_has_calls([
            call('Amet consectetur', bold=True, fg=None),
            call('----------------', bold=True, fg=None),
        ])
        click.echo.assert_called_once_with()
Пример #2
0
    def test_print_heading_2(self, click):
        ConsolePrinter.print_heading(
            'Dolor sic', ConsolePrinter.HEADING_LEVEL_TWO)

        assert click.secho.call_count == 3
        click.secho.assert_has_calls([
            call('---------', bold=True, fg=None),
            call('Dolor sic', bold=True, fg=None),
            call('---------', bold=True, fg=None),
        ])
        click.echo.assert_called_once_with()
Пример #3
0
    def test_print_heading_1(self, click, style, expected_color):
        ConsolePrinter.print_heading(
            'Lorem ipsum', ConsolePrinter.HEADING_LEVEL_ONE, style)

        assert click.secho.call_count == 3
        click.secho.assert_has_calls([
            call('===========', bold=True, fg=expected_color),
            call('Lorem ipsum', bold=True, fg=expected_color),
            call('===========', bold=True, fg=expected_color),
        ])
        click.echo.assert_called_once_with()