Ejemplo n.º 1
0
def test_banner_alternative_stream(mocked_print, repl: Riposte):
    repl.banner = "foobar"
    repl._process = mock.Mock(side_effect=StopIteration)
    repl._parse_args = mock.Mock(return_value=True)

    repl.run()

    mocked_print.assert_not_called()
Ejemplo n.º 2
0
def test_banner(mocked_print, repl: Riposte):
    repl.banner = "foobar"
    repl._process = mock.Mock(side_effect=StopIteration)
    repl._parse_args = mock.Mock(return_value=False)

    repl.run()

    mocked_print.assert_called_once_with(repl.banner)
Ejemplo n.º 3
0
def test_banner_alternative_stream(mocked_print, repl: Riposte):
    repl.banner = "foobar"
    repl.print_banner = False
    repl._process = mock.Mock(side_effect=StopIteration)
    repl.parse_cli_arguments = mock.Mock()

    repl.run()

    mocked_print.assert_not_called()
Ejemplo n.º 4
0
def test_banner(mocked_print, repl: Riposte):
    repl.banner = "foobar"
    repl.print_banner = True
    repl._process = mock.Mock(side_effect=StopIteration)
    repl.parse_cli_arguments = mock.Mock()

    repl.run()

    mocked_print.assert_called_once_with(repl.banner)