mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-05 08:51:20 +00:00
* Updating tests : stocks > due_diligence * Updating tests : terminal * Updating tests : stocks > fundamental analysis > financial_modeling_prep * Updating tests : stocks > fundamental_analysis * Updating tests : stocks/fundamental_analysis/controller * Updating tests : stocks/fundamental_analysis/txt/controller * Updating tests : stocks/fundamental_analysis/yahoo_finance * Updating tests : stocks/fundamental_analysis/finviz_view * Updating tests : stocks/fundamental_analysis/finviz_view * Updating tests : stocks/due_diligence/finviz_view * Updating tests : stocks\fundamental_analysis\yahoo_finance * Updating tests : stocks\due_diligence\yahoo_finance * Updating tests : black * Updating tests : pylint * Updating tests : pep8 * Updating tests : black
34 lines
1.0 KiB
Python
34 lines
1.0 KiB
Python
import pytest
|
|
import terminal
|
|
|
|
|
|
@pytest.mark.vcr(record_mode="none")
|
|
@pytest.mark.record_stdout
|
|
def test_terminal_quick_exit(mocker, monkeypatch):
|
|
monkeypatch.setattr(terminal.gtff, "ENABLE_QUICK_EXIT", True)
|
|
monkeypatch.setattr(terminal.gtff, "USE_ION", False)
|
|
monkeypatch.setattr(terminal.gtff, "USE_PROMPT_TOOLKIT", True)
|
|
|
|
mocker.patch("sys.stdin")
|
|
|
|
terminal.terminal()
|
|
|
|
|
|
@pytest.mark.vcr(record_mode="none")
|
|
@pytest.mark.record_stdout
|
|
def test_terminal_quit(mocker, monkeypatch):
|
|
monkeypatch.setattr(terminal.gtff, "ENABLE_QUICK_EXIT", False)
|
|
monkeypatch.setattr(terminal.gtff, "USE_ION", False)
|
|
monkeypatch.setattr(terminal.gtff, "USE_PROMPT_TOOLKIT", True)
|
|
|
|
mocker.patch("sys.stdin")
|
|
mocker.patch("builtins.input", return_value="quit")
|
|
mocker.patch("terminal.session")
|
|
mocker.patch("terminal.session.prompt", return_value="quit")
|
|
mocker.patch("terminal.print_goodbye")
|
|
spy_print_goodbye = mocker.spy(terminal, "print_goodbye")
|
|
|
|
terminal.terminal()
|
|
|
|
spy_print_goodbye.assert_called_once()
|