~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testinv.py

  • Committer: Martin Pool
  • Date: 2005-07-22 23:32:00 UTC
  • Revision ID: mbp@sourcefrog.net-20050722233200-ccdeca985093a9fb
- now needs python 2.4
- update instructions for running selftest

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
 
from bzrlib.selftest import TestCase
 
17
from bzrlib.selftest import TestBase
18
18
 
19
19
from bzrlib.inventory import Inventory, InventoryEntry
20
20
 
21
 
 
22
 
class TestInventory(TestCase):
23
 
 
24
 
    def test_is_within(self):
25
 
        from bzrlib.osutils import is_inside_any
26
 
        
27
 
        for dirs, fn in [(['src', 'doc'], 'src/foo.c'),
28
 
                         (['src'], 'src/foo.c'),
29
 
                         (['src'], 'src'),
30
 
                         ]:
31
 
            self.assert_(is_inside_any(dirs, fn))
32
 
            
33
 
        for dirs, fn in [(['src'], 'srccontrol'),
34
 
                         (['src'], 'srccontrol/foo')]:
35
 
            self.assertFalse(is_inside_any(dirs, fn))
36
 
            
37
 
    def test_ids(self):
 
21
class TestIsWithin(TestBase):
 
22
    def runTest(self):
38
23
        """Test detection of files within selected directories."""
39
24
        inv = Inventory()
40
25
        
49
34
        self.assertEqual(inv.path2id('src/bye.c'), 'bye-id')
50
35
        
51
36
        self.assert_('src-id' in inv)
52
 
 
53
 
 
54
 
    def test_version(self):
55
 
        """Inventory remembers the text's version."""
56
 
        inv = Inventory()
57
 
        ie = inv.add_path('foo.txt', 'file')
58
 
        ## XXX
59
 
 
 
37
        
 
38
        
 
 
b'\\ No newline at end of file'