~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_inv.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-10-15 16:32:29 UTC
  • mfrom: (1731.1.67 unique-root)
  • Revision ID: pqm@pqm.ubuntu.com-20061015163229-648b1f2ebe692136
New trees have unique root ids

Show diffs side-by-side

added added

removed removed

Lines of Context:
544
544
        os.unlink('b1/a')
545
545
        wt.revert([])
546
546
        self.assertEqual(len(wt.inventory), 1)
 
547
 
 
548
 
 
549
class TestIsRoot(TestCase):
 
550
    """Ensure our root-checking code is accurate."""
 
551
 
 
552
    def test_is_root(self):
 
553
        inv = Inventory('TREE_ROOT')
 
554
        self.assertTrue(inv.is_root('TREE_ROOT'))
 
555
        self.assertFalse(inv.is_root('booga'))
 
556
        inv.root.file_id = 'booga'
 
557
        self.assertFalse(inv.is_root('TREE_ROOT'))
 
558
        self.assertTrue(inv.is_root('booga'))
 
559
        # works properly even if no root is set
 
560
        inv.root = None
 
561
        self.assertFalse(inv.is_root('TREE_ROOT'))
 
562
        self.assertFalse(inv.is_root('booga'))