~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_registry.py

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2008-2011 Canonical Ltd
 
1
# Copyright (C) 2006, 2008-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
272
272
        """
273
273
        os.mkdir('tmp')
274
274
        plugin_name = 'bzr_plugin_a_%s' % (osutils.rand_chars(4),)
275
 
        open('tmp/'+plugin_name+'.py', 'wb').write(contents)
 
275
        with open('tmp/'+plugin_name+'.py', 'wb') as f: f.write(contents)
276
276
        return plugin_name
277
277
 
278
278
    def create_simple_plugin(self):
344
344
        a_registry = registry.Registry()
345
345
        a_registry.register_lazy('obj', "bzrlib.tests.test_registry",
346
346
            'object1')
347
 
        self.assertEquals("bzrlib.tests.test_registry",
 
347
        self.assertEqual("bzrlib.tests.test_registry",
348
348
            a_registry._get_module("obj"))
349
349
 
350
350
    def test_normal_get_module(self):
352
352
            """Something"""
353
353
        a_registry = registry.Registry()
354
354
        a_registry.register("obj", AThing())
355
 
        self.assertEquals("bzrlib.tests.test_registry",
 
355
        self.assertEqual("bzrlib.tests.test_registry",
356
356
            a_registry._get_module("obj"))