summaryrefslogtreecommitdiff
path: root/tests/test_quickstart.py
diff options
context:
space:
mode:
authorshimizukawa <shimizukawa@gmail.com>2012-11-28 23:21:02 +0900
committershimizukawa <shimizukawa@gmail.com>2012-11-28 23:21:02 +0900
commite31620fb477769a2fc01b49d1d94b3cce25c8d36 (patch)
tree8494f6bc56d4af66880c74d25204e1184de29ede /tests/test_quickstart.py
parent4eca27e2f8e6f69a57ff3f6c2c5c8908ae199e95 (diff)
downloadsphinx-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.py19
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 = {