~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_inv.py

  • Committer: Martin Pool
  • Date: 2010-04-01 04:41:18 UTC
  • mto: This revision was merged to the branch mainline in revision 5128.
  • Revision ID: mbp@sourcefrog.net-20100401044118-shyctqc02ob08ngz
ignore .testrepository

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2008, 2009 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
18
18
from bzrlib import (
19
19
    chk_map,
20
20
    groupcompress,
 
21
    bzrdir,
21
22
    errors,
22
23
    inventory,
23
24
    osutils,
589
590
        self.assertFalse(inv.is_root('TREE_ROOT'))
590
591
        self.assertFalse(inv.is_root('booga'))
591
592
 
592
 
    def test_entries_for_empty_inventory(self):
593
 
        """Test that entries() will not fail for an empty inventory"""
594
 
        inv = Inventory(root_id=None)
595
 
        self.assertEqual([], inv.entries())
596
 
 
597
593
 
598
594
class TestInventoryEntry(TestCase):
599
595
 
611
607
 
612
608
    def test_dir_detect_changes(self):
613
609
        left = inventory.InventoryDirectory('123', 'hello.c', ROOT_ID)
 
610
        left.text_sha1 = 123
 
611
        left.executable = True
 
612
        left.symlink_target='foo'
614
613
        right = inventory.InventoryDirectory('123', 'hello.c', ROOT_ID)
 
614
        right.text_sha1 = 321
 
615
        right.symlink_target='bar'
615
616
        self.assertEqual((False, False), left.detect_changes(right))
616
617
        self.assertEqual((False, False), right.detect_changes(left))
617
618
 
631
632
 
632
633
    def test_symlink_detect_changes(self):
633
634
        left = inventory.InventoryLink('123', 'hello.c', ROOT_ID)
 
635
        left.text_sha1 = 123
 
636
        left.executable = True
634
637
        left.symlink_target='foo'
635
638
        right = inventory.InventoryLink('123', 'hello.c', ROOT_ID)
 
639
        right.text_sha1 = 321
636
640
        right.symlink_target='foo'
637
641
        self.assertEqual((False, False), left.detect_changes(right))
638
642
        self.assertEqual((False, False), right.detect_changes(left))