/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testinv.py

  • Committer: Robert Collins
  • Date: 2005-09-28 04:58:18 UTC
  • mto: (1092.2.19)
  • mto: This revision was merged to the branch mainline in revision 1391.
  • Revision ID: robertc@robertcollins.net-20050928045818-c5ce6c7cc796f6fc
patch from Rob Weir to correct bzr-man.py

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 TestBase
 
17
import os
 
18
from bzrlib.selftest import TestCase
18
19
 
19
20
from bzrlib.inventory import Inventory, InventoryEntry
20
21
 
21
22
 
22
 
class TestIsWithin(TestBase):
23
 
    def runTest(self):
 
23
class TestInventory(TestCase):
 
24
 
 
25
    def test_is_within(self):
24
26
        from bzrlib.osutils import is_inside_any
25
 
        
26
 
        for dirs, fn in [(['src', 'doc'], 'src/foo.c'),
27
 
                         (['src'], 'src/foo.c'),
 
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),
28
31
                         (['src'], 'src'),
29
32
                         ]:
30
33
            self.assert_(is_inside_any(dirs, fn))
33
36
                         (['src'], 'srccontrol/foo')]:
34
37
            self.assertFalse(is_inside_any(dirs, fn))
35
38
            
36
 
            
37
 
            
38
 
class TestInventoryIds(TestBase):
39
 
    def runTest(self):
 
39
    def test_ids(self):
40
40
        """Test detection of files within selected directories."""
41
41
        inv = Inventory()
42
42
        
51
51
        self.assertEqual(inv.path2id('src/bye.c'), 'bye-id')
52
52
        
53
53
        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