/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/per_repository_vf/test_repository.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for repository implementations - tests a repository format."""
18
18
 
19
 
from bzrlib import (
 
19
from breezy import (
20
20
    errors,
21
21
    gpg,
22
22
    inventory,
27
27
    vf_repository,
28
28
    )
29
29
 
30
 
from bzrlib.symbol_versioning import deprecated_in
31
 
from bzrlib.tests.matchers import MatchesAncestry
32
 
from bzrlib.tests.per_repository_vf import (
 
30
from breezy.symbol_versioning import deprecated_in
 
31
from breezy.tests.matchers import MatchesAncestry
 
32
from breezy.tests.per_repository_vf import (
33
33
    TestCaseWithRepository,
34
34
    all_repository_vf_format_scenarios,
35
35
    )
36
 
from bzrlib.tests.scenarios import load_tests_apply_scenarios
 
36
from breezy.tests.scenarios import load_tests_apply_scenarios
37
37
 
38
38
 
39
39
load_tests = load_tests_apply_scenarios
69
69
        rev_id = (tree.commit('a'),)
70
70
        tree.lock_read()
71
71
        self.addCleanup(tree.unlock)
72
 
        self.assertEqual(set([rev_id]), set(repo.inventories.keys()))
 
72
        self.assertEqual({rev_id}, set(repo.inventories.keys()))
73
73
 
74
74
    def test_attribute_revision_store(self):
75
75
        """Test the existence of the revisions attribute."""
86
86
        try:
87
87
            self.assertEqual(set(), set(repo.revisions.keys()))
88
88
            revid = (tree.commit("foo"),)
89
 
            self.assertEqual(set([revid]), set(repo.revisions.keys()))
 
89
            self.assertEqual({revid}, set(repo.revisions.keys()))
90
90
            self.assertEqual({revid:()},
91
91
                repo.revisions.get_parent_map([revid]))
92
92
        finally:
99
99
        merge_id = (tree.commit('merged'),)
100
100
        repo.lock_read()
101
101
        self.addCleanup(repo.unlock)
102
 
        self.assertEqual(set([revid, left_id, right_id, merge_id]),
 
102
        self.assertEqual({revid, left_id, right_id, merge_id},
103
103
            set(repo.revisions.keys()))
104
104
        self.assertEqual({revid:(), left_id:(revid,), right_id:(revid,),
105
105
             merge_id:(right_id, left_id)},
279
279
                    ' platform for this repo format' % (file_id,))
280
280
            if repo._format.rich_root_data:
281
281
                root_commit = (tree.get_root_id(),) + rev_key
282
 
                keys = set([root_commit])
 
282
                keys = {root_commit}
283
283
                parents = {root_commit:()}
284
284
            else:
285
285
                keys = set()
380
380
 
381
381
    def test_all_revision_ids(self):
382
382
        # all_revision_ids -> all revisions
383
 
        self.assertEqual(set(['rev1', 'rev2', 'rev3', 'rev4']),
 
383
        self.assertEqual({'rev1', 'rev2', 'rev3', 'rev4'},
384
384
            set(self.bzrdir.open_repository().all_revision_ids()))
385
385
 
386
386
    def test_reserved_id(self):