/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to tests/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2010-05-25 17:09:02 UTC
  • mto: This revision was merged to the branch mainline in revision 691.
  • Revision ID: jelmer@samba.org-20100525170902-3to8g5iw7ovw79kh
Split out olive into a separate directory.

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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
 
17
from bzrlib import tests
17
18
 
18
19
def load_tests(basic_tests, module, loader):
19
20
    testmod_names = [
20
21
        'test_annotate_config',
21
 
        'test_avatarsbox',
22
22
        'test_commit',
23
23
        'test_diff',
24
24
        'test_history',
25
 
        'test_graphcell',
26
25
        'test_linegraph',
27
 
        'test_notify',
 
26
        'test_preferences',
28
27
        'test_revisionview',
29
 
        'test_treemodel',
30
28
        ]
31
29
 
32
30
    basic_tests.addTest(loader.loadTestsFromModuleNames(
33
31
            ["%s.%s" % (__name__, tmn) for tmn in testmod_names]))
34
32
    return basic_tests
35
 
 
36
 
 
37
 
class MockMethod():
38
 
 
39
 
    @classmethod
40
 
    def bind(klass, test_instance, obj, method_name):
41
 
        original_method = getattr(obj, method_name)
42
 
        test_instance.addCleanup(setattr, obj, method_name, original_method)
43
 
        setattr(obj, method_name, klass())
44
 
 
45
 
    def __init__(self):
46
 
        self.called = False
47
 
        self.args = None
48
 
        self.kwargs = None
49
 
 
50
 
    def __call__(self, *args, **kwargs):
51
 
        self.called = True
52
 
        self.args = args
53
 
        self.kwargs = kwargs