~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_hooks.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2010 Canonical Ltd
 
1
# Copyright (C) 2007-2012, 2016 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
142
142
            'TestHooks.hooks', 'set_rh', set_rh, "demo")
143
143
        set_rh_lazy_hooks = _mod_hooks._lazy_hooks[
144
144
            ('bzrlib.tests.test_hooks', 'TestHooks.hooks', 'set_rh')]
145
 
        self.assertEquals(1, len(set_rh_lazy_hooks))
146
 
        self.assertEquals(set_rh, set_rh_lazy_hooks[0][0].get_obj())
147
 
        self.assertEquals("demo", set_rh_lazy_hooks[0][1])
 
145
        self.assertEqual(1, len(set_rh_lazy_hooks))
 
146
        self.assertEqual(set_rh, set_rh_lazy_hooks[0][0].get_obj())
 
147
        self.assertEqual("demo", set_rh_lazy_hooks[0][1])
148
148
        self.assertEqual(list(TestHooks.hooks['set_rh']), [set_rh])
149
149
 
150
150
    set_rh = lambda: None
172
172
        for key, callbacks in _mod_hooks._lazy_hooks.iteritems():
173
173
            (module_name, member_name, hook_name) = key
174
174
            obj = pyutils.get_named_object(module_name, member_name)
175
 
            self.assertEquals(obj._module, module_name)
176
 
            self.assertEquals(obj._member_name, member_name)
 
175
            self.assertEqual(obj._module, module_name)
 
176
            self.assertEqual(obj._member_name, member_name)
177
177
            self.assertTrue(hook_name in obj)
178
178
            self.assertIs(callbacks, obj[hook_name]._callbacks)
179
179