~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: 2006-05-12 23:48:49 UTC
  • mfrom: (1704.2.13 bzr.mbp.integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060512234849-259ff209fff58489
(mbp) various fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
import os
21
21
from StringIO import StringIO
 
22
import re
22
23
import sys
23
24
 
24
25
import bzrlib
163
164
            self.apply_redirected(
164
165
                None, factory.stdout, factory.stdout, factory.get_boolean, "what do you want")
165
166
            )
166
 
        self.assertEqual(
167
 
            "\r/ [                                                                   ] foo 0/1"
168
 
            "\r                                                                               "
169
 
            "\rwhat do you want? [y/n]:what do you want? [y/n]:", factory.stdout.getvalue())
 
167
        # use a regular expression so that we don't depend on the particular
 
168
        # screen width - could also set and restore $COLUMN if that has
 
169
        # priority on all platforms, but it doesn't at present.
 
170
        output = factory.stdout.getvalue()
 
171
        if not re.match(
 
172
            "\r/ \\[    *\\] foo 0/1"
 
173
            "\r   *" 
 
174
            "\rwhat do you want\\? \\[y/n\\]:what do you want\\? \\[y/n\\]:", 
 
175
            output):
 
176
            self.fail("didn't match factory output %r" % factory)