~ubuntu-branches/ubuntu/lucid/bzr/lucid-proposed

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jeff Bailey
  • Date: 2006-03-20 08:31:00 UTC
  • mfrom: (1.1.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060320083100-ovdi2ssuw0epcx8s
Tags: 0.8~200603200831-0ubuntu1
* Snapshot uploaded to Dapper at Martin Pool's request.

* Disable testsuite for upload.  Fakeroot and the testsuite don't
  play along.

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
 
from bzrlib.tests import TestLoader
27
 
from bzrlib.tests import TestCaseInTempDir, BzrTestBase
 
26
from bzrlib.tests import (
 
27
                          _load_module_by_name,
 
28
                          TestCaseWithTransport,
 
29
                          TestSuite,
 
30
                          TestLoader,
 
31
                          )
 
32
import bzrlib.ui as ui
 
33
 
28
34
 
29
35
def test_suite():
30
36
    testmod_names = [
31
37
                     'bzrlib.tests.blackbox.test_added',
 
38
                     'bzrlib.tests.blackbox.test_aliases',
 
39
                     'bzrlib.tests.blackbox.test_ancestry',
 
40
                     'bzrlib.tests.blackbox.test_break_lock',
 
41
                     'bzrlib.tests.blackbox.test_bound_branches',
32
42
                     'bzrlib.tests.blackbox.test_cat',
 
43
                     'bzrlib.tests.blackbox.test_checkout',
 
44
                     'bzrlib.tests.blackbox.test_commit',
 
45
                     'bzrlib.tests.blackbox.test_conflicts',
 
46
                     'bzrlib.tests.blackbox.test_diff',
33
47
                     'bzrlib.tests.blackbox.test_export',
 
48
                     'bzrlib.tests.blackbox.test_find_merge_base',
 
49
                     'bzrlib.tests.blackbox.test_help',
 
50
                     'bzrlib.tests.blackbox.test_info',
34
51
                     'bzrlib.tests.blackbox.test_log',
 
52
                     'bzrlib.tests.blackbox.test_logformats',
35
53
                     'bzrlib.tests.blackbox.test_missing',
 
54
                     'bzrlib.tests.blackbox.test_outside_wt',
36
55
                     'bzrlib.tests.blackbox.test_pull',
 
56
                     'bzrlib.tests.blackbox.test_reconcile',
 
57
                     'bzrlib.tests.blackbox.test_re_sign',
 
58
                     'bzrlib.tests.blackbox.test_revert',
37
59
                     'bzrlib.tests.blackbox.test_revno',
38
60
                     'bzrlib.tests.blackbox.test_revision_info',
 
61
                     'bzrlib.tests.blackbox.test_selftest',
 
62
                     'bzrlib.tests.blackbox.test_sign_my_commits',
39
63
                     'bzrlib.tests.blackbox.test_status',
40
64
                     'bzrlib.tests.blackbox.test_too_much',
 
65
                     'bzrlib.tests.blackbox.test_update',
 
66
                     'bzrlib.tests.blackbox.test_upgrade',
41
67
                     'bzrlib.tests.blackbox.test_versioning',
42
68
                     ]
43
 
    return TestLoader().loadTestsFromNames(testmod_names)
44
 
 
45
 
 
46
 
class ExternalBase(TestCaseInTempDir):
 
69
 
 
70
    suite = TestSuite()
 
71
    loader = TestLoader()
 
72
    for mod_name in testmod_names:
 
73
        mod = _load_module_by_name(mod_name)
 
74
        suite.addTest(loader.loadTestsFromModule(mod))
 
75
    return suite
 
76
 
 
77
 
 
78
class ExternalBase(TestCaseWithTransport):
47
79
 
48
80
    def runbzr(self, args, retcode=0, backtick=False):
49
81
        if isinstance(args, basestring):
52
84
            return self.run_bzr_captured(args, retcode=retcode)[0]
53
85
        else:
54
86
            return self.run_bzr_captured(args, retcode=retcode)
 
87
 
 
88
 
 
89
class TestUIFactory(ui.UIFactory):
 
90
    """A UI Factory for testing - hide the progress bar but emit note()s."""
 
91
 
 
92
    def clear(self):
 
93
        """See progress.ProgressBar.clear()."""
 
94
 
 
95
    def note(self, fmt_string, *args, **kwargs):
 
96
        """See progress.ProgressBar.note()."""
 
97
        print fmt_string % args
 
98
 
 
99
    def progress_bar(self):
 
100
        return self
 
101
        
 
102
    def update(self, message, count=None, total=None):
 
103
        """See progress.ProgressBar.update()."""