Example #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()
Example #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)
Example #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()
Example #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)