~ubuntu-branches/ubuntu/karmic/bzr/karmic-proposed

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2008-05-12 00:14:54 UTC
  • mfrom: (1.1.42 upstream)
  • Revision ID: james.westby@ubuntu.com-20080512001454-yjpajuiocykl48p9
Tags: 1.5~rc1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005 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
16
16
 
17
17
import os
18
18
 
 
19
from bzrlib.tests import TestNotApplicable
19
20
from bzrlib.tests.workingtree_implementations import TestCaseWithWorkingTree
20
21
from bzrlib.branch import Branch
21
22
from bzrlib import inventory
30
31
        # not separate is mandatory.
31
32
        if isinstance(self.workingtree_format,
32
33
            bzrlib.workingtree_4.WorkingTreeFormat4):
33
 
            return
 
34
            raise TestNotApplicable("not applicable to %r"
 
35
                % (self.workingtree_format,))
34
36
        # TODO: jam 20051218 this probably should add more than just
35
37
        #                    a couple files to the inventory
36
38
 
41
43
        t.add('a')
42
44
        t.commit('a', rev_id='r1')
43
45
 
44
 
        t._control_files.get_utf8('basis-inventory-cache')
 
46
        self.assertTrue(t._control_files._transport.has('basis-inventory-cache'))
45
47
 
46
48
        basis_inv = t.basis_tree().inventory
47
49
        self.assertEquals('r1', basis_inv.revision_id)
53
55
        t.add('b')
54
56
        t.commit('b', rev_id='r2')
55
57
 
56
 
        t._control_files.get_utf8('basis-inventory-cache')
 
58
        self.assertTrue(t._control_files._transport.has('basis-inventory-cache'))
57
59
 
58
60
        basis_inv_txt = t.read_basis_inventory()
59
61
        basis_inv = bzrlib.xml7.serializer_v7.read_inventory_from_string(basis_inv_txt)
68
70
        # not separate and ignorable.
69
71
        if isinstance(self.workingtree_format,
70
72
            bzrlib.workingtree_4.WorkingTreeFormat4):
71
 
            return
 
73
            raise TestNotApplicable("not applicable to %r"
 
74
                % (self.workingtree_format,))
72
75
        t = self.make_branch_and_tree('.')
73
76
        b = t.branch
74
77
        open('a', 'wb').write('a\n')