~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-10-05 21:15:13 UTC
  • mfrom: (5448.3.5 374700-Add-gnu-lsh-support)
  • Revision ID: pqm@pqm.ubuntu.com-20101005211513-whouyj5t7oo92gmq
(gz) Add support for GNU lsh as a secure shell client (Matthew Gordon)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2009, 2011, 2012, 2016 Canonical Ltd
 
1
# Copyright (C) 2004, 2005, 2008 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
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
 
17
19
from bzrlib.tests import TestNotApplicable
18
20
from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
 
21
from bzrlib.branch import Branch
 
22
from bzrlib import inventory
 
23
from bzrlib.revision import Revision
19
24
import bzrlib.xml6
20
25
 
21
26
 
34
39
        # Make sure the basis file is created by a commit
35
40
        t = self.make_branch_and_tree('.')
36
41
        b = t.branch
37
 
        with open('a', 'wb') as f: f.write('a\n')
 
42
        open('a', 'wb').write('a\n')
38
43
        t.add('a')
39
44
        t.commit('a', rev_id='r1')
40
45
 
41
46
        self.assertTrue(t._transport.has('basis-inventory-cache'))
42
47
 
43
 
        basis_inv = t.basis_tree().root_inventory
44
 
        self.assertEqual('r1', basis_inv.revision_id)
 
48
        basis_inv = t.basis_tree().inventory
 
49
        self.assertEquals('r1', basis_inv.revision_id)
45
50
 
46
51
        store_inv = b.repository.get_inventory('r1')
47
52
        self.assertEqual([], store_inv._make_delta(basis_inv))
48
53
 
49
 
        with open('b', 'wb') as f: f.write('b\n')
 
54
        open('b', 'wb').write('b\n')
50
55
        t.add('b')
51
56
        t.commit('b', rev_id='r2')
52
57
 
54
59
 
55
60
        basis_inv_txt = t.read_basis_inventory()
56
61
        basis_inv = bzrlib.xml7.serializer_v7.read_inventory_from_string(basis_inv_txt)
57
 
        self.assertEqual('r2', basis_inv.revision_id)
 
62
        self.assertEquals('r2', basis_inv.revision_id)
58
63
        store_inv = b.repository.get_inventory('r2')
59
64
 
60
65
        self.assertEqual([], store_inv._make_delta(basis_inv))
69
74
                % (self.workingtree_format,))
70
75
        t = self.make_branch_and_tree('.')
71
76
        b = t.branch
72
 
        with open('a', 'wb') as f: f.write('a\n')
 
77
        open('a', 'wb').write('a\n')
73
78
        t.add('a')
74
79
        t.commit('a', rev_id='r1')
75
80
        t._transport.put_bytes('basis-inventory-cache', 'booga')