/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-04-07 22:46:52 UTC
  • mfrom: (1645 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1727.
  • Revision ID: aaron.bentley@utoronto.ca-20060407224652-4925bc3735b926f8
Merged latest bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 by Canonical Ltd
 
1
# Copyright (C) 2005, 2006 by Canonical Ltd
2
2
# -*- coding: utf-8 -*-
3
3
 
4
4
# This program is free software; you can redistribute it and/or modify
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 = [
 
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',
31
42
                     'bzrlib.tests.blackbox.test_cat',
32
 
                     'bzrlib.tests.blackbox.test_too_much',
 
43
                     'bzrlib.tests.blackbox.test_checkout',
 
44
                     'bzrlib.tests.blackbox.test_commit',
 
45
                     'bzrlib.tests.blackbox.test_conflicts',
 
46
                     'bzrlib.tests.blackbox.test_diff',
 
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',
 
51
                     'bzrlib.tests.blackbox.test_init',
 
52
                     'bzrlib.tests.blackbox.test_log',
 
53
                     'bzrlib.tests.blackbox.test_logformats',
 
54
                     'bzrlib.tests.blackbox.test_missing',
 
55
                     'bzrlib.tests.blackbox.test_outside_wt',
33
56
                     'bzrlib.tests.blackbox.test_pull',
 
57
                     'bzrlib.tests.blackbox.test_reconcile',
 
58
                     'bzrlib.tests.blackbox.test_re_sign',
 
59
                     'bzrlib.tests.blackbox.test_revert',
34
60
                     'bzrlib.tests.blackbox.test_revno',
 
61
                     'bzrlib.tests.blackbox.test_revision_info',
 
62
                     'bzrlib.tests.blackbox.test_selftest',
 
63
                     'bzrlib.tests.blackbox.test_shared_repository',
 
64
                     'bzrlib.tests.blackbox.test_sign_my_commits',
 
65
                     'bzrlib.tests.blackbox.test_status',
 
66
                     'bzrlib.tests.blackbox.test_too_much',
 
67
                     'bzrlib.tests.blackbox.test_update',
 
68
                     'bzrlib.tests.blackbox.test_upgrade',
35
69
                     'bzrlib.tests.blackbox.test_versioning',
36
70
                     ]
37
 
    return TestLoader().loadTestsFromNames(testmod_names)
38
 
 
39
 
 
40
 
class ExternalBase(TestCaseInTempDir):
 
71
 
 
72
    suite = TestSuite()
 
73
    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
 
78
 
 
79
 
 
80
class ExternalBase(TestCaseWithTransport):
41
81
 
42
82
    def runbzr(self, args, retcode=0, backtick=False):
43
83
        if isinstance(args, basestring):
46
86
            return self.run_bzr_captured(args, retcode=retcode)[0]
47
87
        else:
48
88
            return self.run_bzr_captured(args, retcode=retcode)
 
89
 
 
90
 
 
91
class TestUIFactory(ui.UIFactory):
 
92
    """A UI Factory for testing - hide the progress bar but emit note()s."""
 
93
 
 
94
    def clear(self):
 
95
        """See progress.ProgressBar.clear()."""
 
96
 
 
97
    def finished(self):
 
98
        """See progress.ProgressBar.finished()."""
 
99
 
 
100
    def note(self, fmt_string, *args, **kwargs):
 
101
        """See progress.ProgressBar.note()."""
 
102
        print fmt_string % args
 
103
 
 
104
    def progress_bar(self):
 
105
        return self
 
106
    
 
107
    def nested_progress_bar(self):
 
108
        return self
 
109
 
 
110
    def update(self, message, count=None, total=None):
 
111
        """See progress.ProgressBar.update()."""