~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_uifactory/__init__.py

Merge bzr.dev, update to use new hooks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2009, 2010, 2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
66
66
        # confirm_action should be answered by every ui factory; even
67
67
        # noninteractive ones should have a reasonable default
68
68
        self._load_responses([True])
69
 
        result = self.factory.confirm_action(
70
 
            'Break a lock?',
71
 
            'bzr.lock.break.confirm',
 
69
        result = self.factory.confirm_action(u'Break a lock?',
 
70
             'bzr.lock.break.confirm',
72
71
            {})
73
72
        # will be true either because we read it from the input or because
74
73
        # that's the default
102
101
    def test_transport_activity(self):
103
102
        # It doesn't matter what the implementation does, we just want to make
104
103
        # sure the interface is there
105
 
        t = transport.get_transport('memory:///')
 
104
        t = transport.get_transport_from_url('memory:///')
106
105
        self.factory.report_transport_activity(t, 1000, 'write')
107
106
        self.factory.report_transport_activity(t, 2000, 'read')
108
107
        self.factory.report_transport_activity(t, 4000, None)
113
112
 
114
113
    def test_no_transport_activity(self):
115
114
        # No activity to report
116
 
        t = transport.get_transport('memory:///')
 
115
        t = transport.get_transport_from_url('memory:///')
117
116
        self.factory.log_transport_activity(display=True)
118
117
        self._check_log_transport_activity_display_no_bytes()
119
118
 
190
189
 
191
190
        # Remove 'TERM' == 'dumb' which causes us to *not* treat output as a
192
191
        # real terminal, even though isatty returns True
193
 
        self._captureVar('TERM', None)
 
192
        self.overrideEnv('TERM', None)
194
193
        self.stderr = TTYStringIO()
195
194
        self.stdout = TTYStringIO()
196
195
        self.factory = ui.text.TextUIFactory(self.stdin, self.stdout,