~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ui.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-06-30 06:35:06 UTC
  • mfrom: (4491.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090630063506-f7wlyoa0ldu816g0
(mbp) accept uppercase Y/N from get_boolean

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
    def assert_get_bool_acceptance_of_user_input(self, factory):
177
177
        factory.stdin = StringIO("y\nyes with garbage\n"
178
178
                                 "yes\nn\nnot an answer\n"
179
 
                                 "no\nfoo\n")
 
179
                                 "no\n"
 
180
                                 "N\nY\n"
 
181
                                 "foo\n"
 
182
                                )
180
183
        factory.stdout = StringIO()
181
184
        factory.stderr = StringIO()
182
185
        # there is no output from the base factory
184
187
        self.assertEqual(True, factory.get_boolean(""))
185
188
        self.assertEqual(False, factory.get_boolean(""))
186
189
        self.assertEqual(False, factory.get_boolean(""))
 
190
        self.assertEqual(False, factory.get_boolean(""))
 
191
        self.assertEqual(True, factory.get_boolean(""))
187
192
        self.assertEqual("foo\n", factory.stdin.read())
188
193
        # stdin should be empty
189
194
        self.assertEqual('', factory.stdin.readline())