~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: abentley
  • Date: 2006-04-20 23:47:53 UTC
  • mfrom: (1681 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1683.
  • Revision ID: abentley@lappy-20060420234753-6a6874b76f09f86d
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
import os
18
18
 
19
 
from bzrlib.tests import TestCaseWithTransport
 
19
from bzrlib.tests.workingtree_implementations import TestCaseWithWorkingTree
20
20
from bzrlib.branch import Branch
21
21
from bzrlib.xml5 import serializer_v5
22
22
 
23
23
 
24
 
class TestBasisInventory(TestCaseWithTransport):
 
24
class TestBasisInventory(TestCaseWithWorkingTree):
25
25
 
26
26
    def test_create(self):
 
27
        # TODO: jam 20051218 this probably should add more than just
 
28
        #                    a couple files to the inventory
 
29
 
27
30
        # Make sure the basis file is created by a commit
28
31
        t = self.make_branch_and_tree('.')
29
32
        b = t.branch
31
34
        t.add('a')
32
35
        t.commit('a', rev_id='r1')
33
36
 
34
 
        self.failUnlessExists('.bzr/basis-inventory.r1')
 
37
        t._control_files.get_utf8('basis-inventory')
35
38
 
36
 
        basis_inv_txt = t.read_basis_inventory('r1')
37
 
        basis_inv = serializer_v5.read_inventory_from_string(basis_inv_txt)
38
 
        #self.assertEquals('r1', basis_inv.revision_id)
 
39
        basis_inv = t.basis_tree().inventory
 
40
        self.assertEquals('r1', basis_inv.revision_id)
39
41
        
40
42
        store_inv = b.repository.get_inventory('r1')
41
43
        self.assertEquals(store_inv._byid, basis_inv._byid)
44
46
        t.add('b')
45
47
        t.commit('b', rev_id='r2')
46
48
 
47
 
        self.failIfExists('.bzr/basis-inventory.r1')
48
 
        self.failUnlessExists('.bzr/basis-inventory.r2')
 
49
        t._control_files.get_utf8('basis-inventory')
49
50
 
50
 
        basis_inv_txt = t.read_basis_inventory('r2')
 
51
        basis_inv_txt = t.read_basis_inventory()
51
52
        basis_inv = serializer_v5.read_inventory_from_string(basis_inv_txt)
 
53
        self.assertEquals('r2', basis_inv.revision_id)
52
54
        store_inv = b.repository.get_inventory('r2')
53
55
 
54
56
        self.assertEquals(store_inv._byid, basis_inv._byid)