~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_inv.py

  • Committer: John Arbash Meinel
  • Date: 2006-10-16 01:50:48 UTC
  • mfrom: (2078 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2080.
  • Revision ID: john@arbash-meinel.com-20061016015048-0f22df07e38093da
[merge] bzr.dev 2078

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'))