~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 02:54:29 UTC
  • mto: (1393.1.30)
  • mto: This revision was merged to the branch mainline in revision 1400.
  • Revision ID: robertc@robertcollins.net-20051003025429-a9a2b4544b48cdd4
push kind character creation into InventoryEntry and TreeEntry

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
import os
18
 
from bzrlib.selftest import TestCase
 
18
from bzrlib.selftest import TestCase, TestCaseInTempDir
19
19
 
20
 
from bzrlib.inventory import Inventory, InventoryEntry
 
20
from bzrlib.inventory import Inventory, InventoryEntry, ROOT_ID
21
21
 
22
22
 
23
23
class TestInventory(TestCase):
59
59
        ie = inv.add_path('foo.txt', 'file')
60
60
        ## XXX
61
61
 
 
62
 
 
63
class TestInventoryEntry(TestCaseInTempDir):
 
64
 
 
65
    def test_file_kind_character(self):
 
66
        file = InventoryEntry('123', 'hello.c', 'file', ROOT_ID)
 
67
        self.assertEqual(file.kind_character(), '')
 
68
 
 
69
    def test_dir_kind_character(self):
 
70
        dir = InventoryEntry('123', 'hello.c', 'directory', ROOT_ID)
 
71
        self.assertEqual(dir.kind_character(), '/')
 
72
 
 
73
    def test_link_kind_character(self):
 
74
        dir = InventoryEntry('123', 'hello.c', 'symlink', ROOT_ID)
 
75
        self.assertEqual(dir.kind_character(), '')