~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testinv.py

  • Committer: Robert Collins
  • Date: 2005-10-03 14:28:37 UTC
  • mto: (1393.1.30)
  • mto: This revision was merged to the branch mainline in revision 1400.
  • Revision ID: robertc@robertcollins.net-20051003142837-78bf906d4edcbd62
factor out inventory directory logic into 'InventoryDirectory' class

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from bzrlib.branch import Branch
21
21
from bzrlib.diff import internal_diff
22
22
from bzrlib.inventory import Inventory, InventoryEntry, ROOT_ID
 
23
import bzrlib.inventory as inventory
23
24
from bzrlib.osutils import has_symlinks
24
25
from bzrlib.selftest import TestCase, TestCaseInTempDir
25
26
 
71
72
        self.assertEqual(file.kind_character(), '')
72
73
 
73
74
    def test_dir_kind_character(self):
74
 
        dir = InventoryEntry('123', 'hello.c', 'directory', ROOT_ID)
 
75
        dir = inventory.InventoryDirectory('123', 'hello.c', ROOT_ID)
75
76
        self.assertEqual(dir.kind_character(), '/')
76
77
 
77
78
    def test_link_kind_character(self):
79
80
        self.assertEqual(dir.kind_character(), '')
80
81
 
81
82
    def test_dir_detect_changes(self):
82
 
        left = InventoryEntry('123', 'hello.c', 'directory', ROOT_ID)
 
83
        left = inventory.InventoryDirectory('123', 'hello.c', ROOT_ID)
83
84
        left.text_sha1 = 123
84
85
        left.executable = True
85
86
        left.symlink_target='foo'
86
 
        right = InventoryEntry('123', 'hello.c', 'directory', ROOT_ID)
 
87
        right = inventory.InventoryDirectory('123', 'hello.c', ROOT_ID)
87
88
        right.text_sha1 = 321
88
89
        right.symlink_target='bar'
89
90
        self.assertEqual((False, False), left.detect_changes(right))
122
123
        self.failUnless(file.has_text())
123
124
 
124
125
    def test_directory_has_text(self):
125
 
        dir = InventoryEntry('123', 'hello.c', 'directory', ROOT_ID)
 
126
        dir = inventory.InventoryDirectory('123', 'hello.c', ROOT_ID)
126
127
        self.failIf(dir.has_text())
127
128
 
128
129
    def test_link_has_text(self):