~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Patch Queue Manager
  • Date: 2011-10-06 08:34:03 UTC
  • mfrom: (6191.2.1 843900-url-nameerror)
  • Revision ID: pqm@pqm.ubuntu.com-20111006083403-jnsw0exlirg01aed
(mbp) error message without traceback on invalid ubuntu/debian url (bug
 843900) (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1352
1352
        self.assertEqual('fail', err._preformatted_string)
1353
1353
 
1354
1354
    def test_post_repo_init(self):
1355
 
        from bzrlib.controldir import RepoInitHookParams
 
1355
        from bzrlib.bzrdir import RepoInitHookParams
1356
1356
        calls = []
1357
1357
        bzrdir.BzrDir.hooks.install_named_hook('post_repo_init',
1358
1358
            calls.append, None)
1404
1404
    def test_supports_colo(self):
1405
1405
        format = bzrdir.BzrDirMetaFormat1Colo()
1406
1406
        self.assertTrue(format.colocated_branches)
1407
 
 
1408
 
    def test_upgrade_from_2a(self):
1409
 
        tree = self.make_branch_and_tree('.', format='2a')
1410
 
        format = bzrdir.BzrDirMetaFormat1Colo()
1411
 
        self.assertTrue(tree.bzrdir.needs_format_conversion(format))
1412
 
        converter = tree.bzrdir._format.get_converter(format)
1413
 
        result = converter.convert(tree.bzrdir, None)
1414
 
        self.assertIsInstance(result._format, bzrdir.BzrDirMetaFormat1Colo)
1415
 
        self.assertFalse(result.needs_format_conversion(format))
1416
 
 
1417
 
    def test_downgrade_to_2a(self):
1418
 
        tree = self.make_branch_and_tree('.', format='development-colo')
1419
 
        format = bzrdir.BzrDirMetaFormat1()
1420
 
        self.assertTrue(tree.bzrdir.needs_format_conversion(format))
1421
 
        converter = tree.bzrdir._format.get_converter(format)
1422
 
        result = converter.convert(tree.bzrdir, None)
1423
 
        self.assertIsInstance(result._format, bzrdir.BzrDirMetaFormat1)
1424
 
        self.assertFalse(result.needs_format_conversion(format))
1425
 
 
1426
 
    def test_downgrade_to_2a_too_many_branches(self):
1427
 
        tree = self.make_branch_and_tree('.', format='development-colo')
1428
 
        tree.bzrdir.create_branch(name="another-colocated-branch")
1429
 
        converter = tree.bzrdir._format.get_converter(
1430
 
            bzrdir.BzrDirMetaFormat1())
1431
 
        self.assertRaises(errors.BzrError, converter.convert, tree.bzrdir,
1432
 
            None)