mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-01 23:08:43 +01:00
15 lines
402 B
Python
15 lines
402 B
Python
import mock
|
|
from unittest import TestCase
|
|
|
|
from dvc.prompt import confirm
|
|
|
|
|
|
class TestConfirm(TestCase):
|
|
@mock.patch("sys.stdout.isatty", return_value=True)
|
|
@mock.patch("dvc.prompt.input", side_effect=EOFError)
|
|
def test_eof(self, mock_input, mock_isatty):
|
|
ret = confirm("message")
|
|
mock_isatty.assert_called()
|
|
mock_input.assert_called()
|
|
self.assertFalse(ret)
|