~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_registry.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
        a_registry = registry.Registry()
40
40
        self.register_stuff(a_registry)
41
41
 
42
 
        self.failUnless(a_registry.default_key is None)
 
42
        self.assertTrue(a_registry.default_key is None)
43
43
 
44
44
        # test get() (self.default_key is None)
45
45
        self.assertRaises(KeyError, a_registry.get)
49
49
 
50
50
        # test _set_default_key
51
51
        a_registry.default_key = 'five'
52
 
        self.failUnless(a_registry.default_key == 'five')
 
52
        self.assertTrue(a_registry.default_key == 'five')
53
53
        self.assertEqual(5, a_registry.get())
54
54
        self.assertEqual(5, a_registry.get(None))
55
55
        # If they ask for a specific entry, they should get KeyError
64
64
        a_registry = registry.Registry()
65
65
        self.register_stuff(a_registry)
66
66
 
67
 
        self.failUnless('one' in a_registry)
 
67
        self.assertTrue('one' in a_registry)
68
68
        a_registry.remove('one')
69
 
        self.failIf('one' in a_registry)
 
69
        self.assertFalse('one' in a_registry)
70
70
        self.assertRaises(KeyError, a_registry.get, 'one')
71
71
 
72
72
        a_registry.register('one', 'one')
304
304
        self.assertEqual(['function', 'klass', 'module', 'obj'],
305
305
                         sorted(a_registry.keys()))
306
306
        # The plugin should not be loaded until we grab the first object
307
 
        self.failIf(plugin_name in sys.modules)
 
307
        self.assertFalse(plugin_name in sys.modules)
308
308
 
309
309
        # By default the plugin won't be in the search path
310
310
        self.assertRaises(ImportError, a_registry.get, 'obj')
314
314
        try:
315
315
            obj = a_registry.get('obj')
316
316
            self.assertEqual('foo', obj)
317
 
            self.failUnless(plugin_name in sys.modules)
 
317
            self.assertTrue(plugin_name in sys.modules)
318
318
 
319
319
            # Now grab another object
320
320
            func = a_registry.get('function')