/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_ui.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 19:09:26 UTC
  • mfrom: (6622.1.36 breezy)
  • Revision ID: jelmer@jelmer.uk-20170521190926-5vtz8xaf0e9ylrpc
Merge rename to breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
"""Tests for the bzrlib ui
 
17
"""Tests for the breezy ui
18
18
"""
19
19
 
20
20
import time
23
23
 
24
24
from testtools.matchers import *
25
25
 
26
 
from bzrlib import (
 
26
from breezy import (
27
27
    config,
28
28
    remote,
29
29
    tests,
30
30
    ui as _mod_ui,
31
31
    )
32
 
from bzrlib.tests import (
 
32
from breezy.tests import (
33
33
    fixtures,
34
34
    )
35
 
from bzrlib.ui import text as _mod_ui_text
36
 
from bzrlib.tests.testui import (
 
35
from breezy.ui import text as _mod_ui_text
 
36
from breezy.tests.testui import (
37
37
    ProgressRecordingUIFactory,
38
38
    )
39
39
 
76
76
        # turns into reading a regular boolean
77
77
        ui = self.make_test_ui_factory('n\n')
78
78
        self.assertEqual(ui.confirm_action(u'Should %(thing)s pass?',
79
 
            'bzrlib.tests.test_ui.confirmation',
 
79
            'breezy.tests.test_ui.confirmation',
80
80
            {'thing': 'this'},),
81
81
            False)
82
82
 
287
287
        self.assertEqual('', ui.stdout.getvalue())
288
288
 
289
289
    def test_quietness(self):
290
 
        self.overrideEnv('BZR_PROGRESS_BAR', 'text')
 
290
        self.overrideEnv('BRZ_PROGRESS_BAR', 'text')
291
291
        ui_factory = _mod_ui_text.TextUIFactory(None,
292
292
            TTYStringIO(),
293
293
            TTYStringIO())
298
298
            _mod_ui_text.NullProgressView)
299
299
 
300
300
    def test_text_ui_show_user_warning(self):
301
 
        from bzrlib.repofmt.groupcompress_repo import RepositoryFormat2a
302
 
        from bzrlib.repofmt.knitpack_repo import RepositoryFormatKnitPack5
 
301
        from breezy.repofmt.groupcompress_repo import RepositoryFormat2a
 
302
        from breezy.repofmt.knitpack_repo import RepositoryFormatKnitPack5
303
303
        err = StringIO()
304
304
        out = StringIO()
305
305
        ui = tests.TextUIFactory(stdin=None, stdout=out, stderr=err)
374
374
            (FileStringIO, 'dumb', 'text', _mod_ui_text.TextProgressView),
375
375
            ):
376
376
            self.overrideEnv('TERM', term)
377
 
            self.overrideEnv('BZR_PROGRESS_BAR', pb)
 
377
            self.overrideEnv('BRZ_PROGRESS_BAR', pb)
378
378
            stdin = file_class('')
379
379
            stderr = file_class()
380
380
            stdout = file_class()
381
381
            uif = _mod_ui.make_ui_for_terminal(stdin, stdout, stderr)
382
382
            self.assertIsInstance(uif, _mod_ui_text.TextUIFactory,
383
 
                "TERM=%s BZR_PROGRESS_BAR=%s uif=%r" % (term, pb, uif,))
 
383
                "TERM=%s BRZ_PROGRESS_BAR=%s uif=%r" % (term, pb, uif,))
384
384
            self.assertIsInstance(uif.make_progress_view(),
385
385
                expected_pb_class,
386
 
                "TERM=%s BZR_PROGRESS_BAR=%s uif=%r" % (term, pb, uif,))
 
386
                "TERM=%s BRZ_PROGRESS_BAR=%s uif=%r" % (term, pb, uif,))
387
387
 
388
388
    def test_text_ui_non_terminal(self):
389
389
        """Even on non-ttys, make_ui_for_terminal gives a text ui."""
509
509
            self.assertEqual(
510
510
                _mod_ui.ConfirmationUserInterfacePolicy(base_ui, answer, {})
511
511
                .confirm_action("Do something?",
512
 
                    "bzrlib.tests.do_something", {}),
 
512
                    "breezy.tests.do_something", {}),
513
513
                answer)
514
514
 
515
515
    def test_confirm_action_specific(self):