~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_basis_inventory.py

  • Committer: Patch Queue Manager
  • Date: 2016-01-31 13:36:59 UTC
  • mfrom: (6613.1.5 1538480-match-hostname)
  • Revision ID: pqm@pqm.ubuntu.com-20160131133659-ouy92ee2wlv9xz8m
(vila) Use ssl.match_hostname instead of our own. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
import os
18
 
 
19
17
from bzrlib.tests import TestNotApplicable
20
18
from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
21
 
from bzrlib.branch import Branch
22
 
from bzrlib import inventory
23
 
from bzrlib.revision import Revision
24
19
import bzrlib.xml6
25
20
 
26
21
 
39
34
        # Make sure the basis file is created by a commit
40
35
        t = self.make_branch_and_tree('.')
41
36
        b = t.branch
42
 
        open('a', 'wb').write('a\n')
 
37
        with open('a', 'wb') as f: f.write('a\n')
43
38
        t.add('a')
44
39
        t.commit('a', rev_id='r1')
45
40
 
46
41
        self.assertTrue(t._transport.has('basis-inventory-cache'))
47
42
 
48
 
        basis_inv = t.basis_tree().inventory
 
43
        basis_inv = t.basis_tree().root_inventory
49
44
        self.assertEquals('r1', basis_inv.revision_id)
50
45
 
51
46
        store_inv = b.repository.get_inventory('r1')
52
47
        self.assertEqual([], store_inv._make_delta(basis_inv))
53
48
 
54
 
        open('b', 'wb').write('b\n')
 
49
        with open('b', 'wb') as f: f.write('b\n')
55
50
        t.add('b')
56
51
        t.commit('b', rev_id='r2')
57
52
 
74
69
                % (self.workingtree_format,))
75
70
        t = self.make_branch_and_tree('.')
76
71
        b = t.branch
77
 
        open('a', 'wb').write('a\n')
 
72
        with open('a', 'wb') as f: f.write('a\n')
78
73
        t.add('a')
79
74
        t.commit('a', rev_id='r1')
80
75
        t._transport.put_bytes('basis-inventory-cache', 'booga')