/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 bzrlib/tests/blackbox/__init__.py

  • Committer: Aaron Bentley
  • Date: 2006-05-20 17:51:13 UTC
  • mfrom: (1718 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1727.
  • Revision ID: aaron.bentley@utoronto.ca-20060520175113-4549e0023f9210bf
Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
rather starts again from the run_bzr function.
24
24
"""
25
25
 
 
26
import sys
 
27
 
26
28
from bzrlib.tests import (
27
 
                          _load_module_by_name,
28
29
                          TestCaseWithTransport,
29
30
                          TestSuite,
30
31
                          TestLoader,
34
35
 
35
36
def test_suite():
36
37
    testmod_names = [
 
38
                     'bzrlib.tests.blackbox.test_add',
37
39
                     'bzrlib.tests.blackbox.test_added',
38
40
                     'bzrlib.tests.blackbox.test_aliases',
39
41
                     'bzrlib.tests.blackbox.test_ancestry',
 
42
                     'bzrlib.tests.blackbox.test_annotate',
40
43
                     'bzrlib.tests.blackbox.test_break_lock',
41
44
                     'bzrlib.tests.blackbox.test_bound_branches',
42
45
                     'bzrlib.tests.blackbox.test_cat',
51
54
                     'bzrlib.tests.blackbox.test_init',
52
55
                     'bzrlib.tests.blackbox.test_log',
53
56
                     'bzrlib.tests.blackbox.test_logformats',
 
57
                     'bzrlib.tests.blackbox.test_merge',
54
58
                     'bzrlib.tests.blackbox.test_missing',
55
59
                     'bzrlib.tests.blackbox.test_outside_wt',
56
60
                     'bzrlib.tests.blackbox.test_pull',
 
61
                     'bzrlib.tests.blackbox.test_push',
57
62
                     'bzrlib.tests.blackbox.test_reconcile',
58
63
                     'bzrlib.tests.blackbox.test_re_sign',
59
64
                     'bzrlib.tests.blackbox.test_revert',
64
69
                     'bzrlib.tests.blackbox.test_sign_my_commits',
65
70
                     'bzrlib.tests.blackbox.test_status',
66
71
                     'bzrlib.tests.blackbox.test_too_much',
 
72
                     'bzrlib.tests.blackbox.test_uncommit',
67
73
                     'bzrlib.tests.blackbox.test_update',
68
74
                     'bzrlib.tests.blackbox.test_upgrade',
69
75
                     'bzrlib.tests.blackbox.test_versioning',
70
76
                     ]
71
77
 
72
 
    suite = TestSuite()
73
78
    loader = TestLoader()
74
 
    for mod_name in testmod_names:
75
 
        mod = _load_module_by_name(mod_name)
76
 
        suite.addTest(loader.loadTestsFromModule(mod))
77
 
    return suite
 
79
    return loader.loadTestsFromModuleNames(testmod_names)
78
80
 
79
81
 
80
82
class ExternalBase(TestCaseWithTransport):
88
90
            return self.run_bzr_captured(args, retcode=retcode)
89
91
 
90
92
 
91
 
class TestUIFactory(ui.UIFactory):
 
93
class TestUIFactory(ui.CLIUIFactory):
92
94
    """A UI Factory for testing - hide the progress bar but emit note()s."""
93
95
 
 
96
    def __init__(self,
 
97
                 stdout=None,
 
98
                 stderr=None):
 
99
        super(TestUIFactory, self).__init__()
 
100
        if stdout is None:
 
101
            self.stdout = sys.stdout
 
102
        else:
 
103
            self.stdout = stdout
 
104
        if stderr is None:
 
105
            self.stderr = sys.stderr
 
106
        else:
 
107
            self.stderr = stderr
 
108
 
94
109
    def clear(self):
95
110
        """See progress.ProgressBar.clear()."""
96
111
 
 
112
    def clear_term(self):
 
113
        """See progress.ProgressBar.clear_term()."""
 
114
 
 
115
    def clear_term(self):
 
116
        """See progress.ProgressBar.clear_term()."""
 
117
 
97
118
    def finished(self):
98
119
        """See progress.ProgressBar.finished()."""
99
120
 
100
121
    def note(self, fmt_string, *args, **kwargs):
101
122
        """See progress.ProgressBar.note()."""
102
 
        print fmt_string % args
 
123
        self.stdout.write((fmt_string + "\n") % args)
103
124
 
104
125
    def progress_bar(self):
105
126
        return self