/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_chk/test_supported.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 repositories that support CHK indices."""
18
18
 
19
 
from bzrlib import (
 
19
from breezy import (
20
20
    btree_index,
21
21
    errors,
22
22
    osutils,
23
23
    repository,
24
24
    )
25
 
from bzrlib.remote import RemoteRepository
26
 
from bzrlib.versionedfile import VersionedFiles
27
 
from bzrlib.tests import TestNotApplicable
28
 
from bzrlib.tests.per_repository_chk import TestCaseWithRepositoryCHK
 
25
from breezy.remote import RemoteRepository
 
26
from breezy.versionedfile import VersionedFiles
 
27
from breezy.tests import TestNotApplicable
 
28
from breezy.tests.per_repository_chk import TestCaseWithRepositoryCHK
29
29
 
30
30
 
31
31
class TestCHKSupport(TestCaseWithRepositoryCHK):
45
45
                self.assertEqual('4e48e2c9a3d2ca8a708cb0cc545700544efb5021',
46
46
                    sha1)
47
47
                self.assertEqual(
48
 
                    set([('sha1:4e48e2c9a3d2ca8a708cb0cc545700544efb5021',)]),
 
48
                    {('sha1:4e48e2c9a3d2ca8a708cb0cc545700544efb5021',)},
49
49
                    repo.chk_bytes.keys())
50
50
            except:
51
51
                repo.abort_write_group()
58
58
        repo.lock_read()
59
59
        try:
60
60
            self.assertEqual(
61
 
                set([('sha1:4e48e2c9a3d2ca8a708cb0cc545700544efb5021',)]),
 
61
                {('sha1:4e48e2c9a3d2ca8a708cb0cc545700544efb5021',)},
62
62
                repo.chk_bytes.keys())
63
63
        finally:
64
64
            repo.unlock()
67
67
        repo.lock_read()
68
68
        try:
69
69
            self.assertEqual(
70
 
                set([('sha1:4e48e2c9a3d2ca8a708cb0cc545700544efb5021',)]),
 
70
                {('sha1:4e48e2c9a3d2ca8a708cb0cc545700544efb5021',)},
71
71
                repo.chk_bytes.keys())
72
72
        finally:
73
73
            repo.unlock()
78
78
        node_lines = ["chknode:\n", "0\n", "1\n", "1\n", "foo\n",
79
79
                      "\x00sha1:%s\n" % (leaf_sha1,)]
80
80
        node_sha1 = osutils.sha_strings(node_lines)
81
 
        expected_set = set([('sha1:' + leaf_sha1,), ('sha1:' + node_sha1,)])
 
81
        expected_set = {('sha1:' + leaf_sha1,), ('sha1:' + node_sha1,)}
82
82
        repo = self.make_repository('.')
83
83
        repo.lock_write()
84
84
        try:
123
123
            self.assertEqual('4e48e2c9a3d2ca8a708cb0cc545700544efb5021',
124
124
                sha1)
125
125
            self.assertEqual(
126
 
                set([('sha1:4e48e2c9a3d2ca8a708cb0cc545700544efb5021',)]),
 
126
                {('sha1:4e48e2c9a3d2ca8a708cb0cc545700544efb5021',)},
127
127
                repo.chk_bytes.keys())
128
128
        except:
129
129
            repo.abort_write_group()