diff options
| author | shimizukawa <shimizukawa@gmail.com> | 2012-11-28 23:21:02 +0900 |
|---|---|---|
| committer | shimizukawa <shimizukawa@gmail.com> | 2012-11-28 23:21:02 +0900 |
| commit | e31620fb477769a2fc01b49d1d94b3cce25c8d36 (patch) | |
| tree | 8494f6bc56d4af66880c74d25204e1184de29ede /tests/test_quickstart.py | |
| parent | 4eca27e2f8e6f69a57ff3f6c2c5c8908ae199e95 (diff) | |
| download | sphinx-e31620fb477769a2fc01b49d1d94b3cce25c8d36.tar.gz | |
fix: sphinx-quickstart asks again and again Y|N because input() return value with extra '\r' on Python-3.2.0 + Windows. closes #1043
Diffstat (limited to 'tests/test_quickstart.py')
| -rw-r--r-- | tests/test_quickstart.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_quickstart.py b/tests/test_quickstart.py index dba888dd..c054f858 100644 --- a/tests/test_quickstart.py +++ b/tests/test_quickstart.py @@ -46,6 +46,25 @@ def teardown_module(): coloron() +def test_quickstart_inputstrip(): + d = {} + answers = { + 'Q1': 'Y\r', # input() return with '\r' on Python-3.2.0 for Windows + 'Q2': ' Yes \r', + 'Q3': 'N', + 'Q4': 'N ', + } + qs.term_input = mock_raw_input(answers) + qs.do_prompt(d, 'k1', 'Q1') + assert d['k1'] == 'Y' + qs.do_prompt(d, 'k2', 'Q2') + assert d['k2'] == 'Yes' + qs.do_prompt(d, 'k3', 'Q3') + assert d['k3'] == 'N' + qs.do_prompt(d, 'k4', 'Q4') + assert d['k4'] == 'N' + + def test_do_prompt(): d = {} answers = { |
