mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-01 23:08:43 +01:00
* tests: moved few unittest tests to pytest * tests: unittest.mock -> pytest-mock in few tests * tests: test_prompt: unittest.mock -> pytest-mock * Update tests/unit/test_daemon.py Co-authored-by: Saugat Pachhai <[email protected]> Co-authored-by: Saugat Pachhai <[email protected]>
11 lines
339 B
Python
11 lines
339 B
Python
from dvc.prompt import confirm
|
|
|
|
|
|
def test_confirm_in_tty_if_stdin_is_closed(mocker):
|
|
mock_input = mocker.patch("dvc.prompt.input", side_effect=EOFError)
|
|
mock_isatty = mocker.patch("sys.stdout.isatty", return_value=True)
|
|
ret = confirm("message")
|
|
mock_isatty.assert_called()
|
|
mock_input.assert_called()
|
|
assert not ret
|