~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Andrew Bennetts
  • Date: 2007-08-30 08:11:54 UTC
  • mfrom: (2766 +trunk)
  • mto: (2535.3.55 repo-refactor)
  • mto: This revision was merged to the branch mainline in revision 2772.
  • Revision ID: andrew.bennetts@canonical.com-20070830081154-16hebp2xwr15x2hc
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
    # Copyright (C) 2005, 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007 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
36
36
                           UnknownFormatError,
37
37
                           UnsupportedFormatError,
38
38
                           )
 
39
from bzrlib.symbol_versioning import (
 
40
    zero_ninetyone,
 
41
    )
39
42
from bzrlib.tests import (
40
43
    TestCase,
41
44
    TestCaseWithTransport,
261
264
        # now open_downlevel should fail too.
262
265
        self.assertRaises(UnknownFormatError, bzrdir.BzrDir.open_unsupported, url)
263
266
 
264
 
    def test_create_repository(self):
 
267
    def test_create_repository_deprecated(self):
 
268
        # new interface is to make the bzrdir, then a repository within that.
265
269
        format = SampleBzrDirFormat()
266
 
        repo = bzrdir.BzrDir.create_repository(self.get_url(), format=format)
 
270
        repo = self.applyDeprecated(zero_ninetyone,
 
271
                bzrdir.BzrDir.create_repository,
 
272
                self.get_url(), format=format)
267
273
        self.assertEqual('A repository', repo)
268
274
 
269
275
    def test_create_repository_shared(self):
 
276
        # new interface is to make the bzrdir, then a repository within that.
270
277
        old_format = bzrdir.BzrDirFormat.get_default_format()
271
 
        repo = bzrdir.BzrDir.create_repository('.', shared=True)
 
278
        repo = self.applyDeprecated(zero_ninetyone,
 
279
                bzrdir.BzrDir.create_repository,
 
280
                '.', shared=True)
272
281
        self.assertTrue(repo.is_shared())
273
282
 
274
283
    def test_create_repository_nonshared(self):
 
284
        # new interface is to make the bzrdir, then a repository within that.
275
285
        old_format = bzrdir.BzrDirFormat.get_default_format()
276
 
        repo = bzrdir.BzrDir.create_repository('.')
 
286
        repo = self.applyDeprecated(zero_ninetyone,
 
287
                bzrdir.BzrDir.create_repository,
 
288
                '.')
277
289
        self.assertFalse(repo.is_shared())
278
290
 
279
291
    def test_create_repository_under_shared(self):
280
292
        # an explicit create_repository always does so.
281
293
        # we trust the format is right from the 'create_repository test'
 
294
        # new interface is to make the bzrdir, then a repository within that.
282
295
        format = bzrdir.format_registry.make_bzrdir('knit')
283
296
        self.make_repository('.', shared=True, format=format)
284
 
        repo = bzrdir.BzrDir.create_repository(self.get_url('child'),
285
 
                                               format=format)
 
297
        repo = self.applyDeprecated(zero_ninetyone,
 
298
                bzrdir.BzrDir.create_repository,
 
299
                self.get_url('child'),
 
300
                format=format)
286
301
        self.assertTrue(isinstance(repo, repository.Repository))
287
302
        self.assertTrue(repo.bzrdir.root_transport.base.endswith('child/'))
288
303