~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testinv.py

  • Committer: Martin Pool
  • Date: 2005-09-05 05:35:25 UTC
  • mfrom: (974.1.55)
  • Revision ID: mbp@sourcefrog.net-20050905053525-2112bac069dbe331
- merge various bug fixes from aaron

aaron.bentley@utoronto.ca-20050905020131-a2d5b7711dd6cd98

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
import os
18
17
from bzrlib.selftest import TestCase
19
18
 
20
19
from bzrlib.inventory import Inventory, InventoryEntry
24
23
 
25
24
    def test_is_within(self):
26
25
        from bzrlib.osutils import is_inside_any
27
 
 
28
 
        SRC_FOO_C = os.path.join('src', 'foo.c')
29
 
        for dirs, fn in [(['src', 'doc'], SRC_FOO_C),
30
 
                         (['src'], SRC_FOO_C),
 
26
        
 
27
        for dirs, fn in [(['src', 'doc'], 'src/foo.c'),
 
28
                         (['src'], 'src/foo.c'),
31
29
                         (['src'], 'src'),
32
30
                         ]:
33
31
            self.assert_(is_inside_any(dirs, fn))
51
49
        self.assertEqual(inv.path2id('src/bye.c'), 'bye-id')
52
50
        
53
51
        self.assert_('src-id' in inv)
54
 
 
55
 
 
56
 
    def test_version(self):
57
 
        """Inventory remembers the text's version."""
58
 
        inv = Inventory()
59
 
        ie = inv.add_path('foo.txt', 'file')
60
 
        ## XXX
61