/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_repository/test_write_group.py

  • Committer: John Arbash Meinel
  • Date: 2010-02-10 17:52:08 UTC
  • mfrom: (5021 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5023.
  • Revision ID: john@arbash-meinel.com-20100210175208-bubuwav4uqigu291
Merge bzr.dev 5021 to resolve NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007 Canonical Ltd
 
1
# Copyright (C) 2007-2010 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
19
19
import sys
20
20
 
21
21
from bzrlib import (
 
22
    branch,
22
23
    bzrdir,
23
24
    errors,
24
25
    graph,
25
26
    memorytree,
26
27
    osutils,
27
28
    remote,
 
29
    tests,
28
30
    versionedfile,
29
31
    )
30
 
from bzrlib.branch import BzrBranchFormat7
31
32
from bzrlib.transport import local, memory
32
 
from bzrlib.tests import TestNotApplicable
33
 
from bzrlib.tests.per_repository import TestCaseWithRepository
34
 
 
35
 
 
36
 
class TestWriteGroup(TestCaseWithRepository):
 
33
from bzrlib.tests import per_repository
 
34
 
 
35
 
 
36
class TestWriteGroup(per_repository.TestCaseWithRepository):
37
37
 
38
38
    def test_start_write_group_unlocked_needs_write_lock(self):
39
39
        repo = self.make_repository('.')
131
131
        self.assertEqual(None, repo.abort_write_group(suppress_errors=True))
132
132
 
133
133
 
134
 
class TestGetMissingParentInventories(TestCaseWithRepository):
 
134
class TestGetMissingParentInventories(per_repository.TestCaseWithRepository):
135
135
 
136
136
    def test_empty_get_missing_parent_inventories(self):
137
137
        """A new write group has no missing parent inventories."""
183
183
        else:
184
184
            repo = self.make_repository(relpath)
185
185
        if not repo._format.supports_external_lookups:
186
 
            raise TestNotApplicable('format not stackable')
187
 
        repo.bzrdir._format.set_branch_format(BzrBranchFormat7())
 
186
            raise tests.TestNotApplicable('format not stackable')
 
187
        repo.bzrdir._format.set_branch_format(branch.BzrBranchFormat7())
188
188
        return repo
189
189
 
190
190
    def reopen_repo_and_resume_write_group(self, repo):
334
334
        repo = self.make_repository('test-repo')
335
335
        if (not repo._format.supports_external_lookups or
336
336
            isinstance(repo, remote.RemoteRepository)):
337
 
            raise TestNotApplicable(
 
337
            raise tests.TestNotApplicable(
338
338
                'only valid for direct connections to resumable repos')
339
339
        # log calls to get_missing_parent_inventories, so that we can assert it
340
340
        # is called with the correct parameters
361
361
        self.assertEqual([True], call_log)
362
362
 
363
363
 
364
 
class TestResumeableWriteGroup(TestCaseWithRepository):
 
364
class TestResumeableWriteGroup(per_repository.TestCaseWithRepository):
365
365
 
366
366
    def make_write_locked_repo(self, relpath='repo'):
367
367
        repo = self.make_repository(relpath)
384
384
            wg_tokens = repo.suspend_write_group()
385
385
        except errors.UnsuspendableWriteGroup:
386
386
            repo.abort_write_group()
387
 
            raise TestNotApplicable(reason)
 
387
            raise tests.TestNotApplicable(reason)
388
388
 
389
389
    def test_suspend_write_group(self):
390
390
        repo = self.make_write_locked_repo()