~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/versioning.py

  • Committer: Martin Pool
  • Date: 2005-07-23 14:21:59 UTC
  • Revision ID: mbp@sourcefrog.net-20050723142159-c7368bcb4db254bb
- more checks for some operations in subdirectories

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
        from bzrlib.commands import run_bzr
74
74
        import os
75
75
        
 
76
        eq = self.assertEqual
 
77
        ass = self.assert_
 
78
        chdir = os.chdir
 
79
        
76
80
        b = Branch('.', init=True)
77
81
        self.build_tree(['src/', 'src/foo.c', 'README'])
78
82
        
79
 
        self.assertEqual(sorted(b.unknowns()),
 
83
        eq(sorted(b.unknowns()),
80
84
                         ['README', 'src'])
81
85
        
82
 
        self.assertEqual(run_bzr(['version']), 0)
83
 
        
84
 
        self.assertEqual(run_bzr(['add']), 0)
85
 
        
86
 
        
 
86
        eq(run_bzr(['version']), 0)
 
87
        
 
88
        eq(run_bzr(['add']), 0)
 
89
        
 
90
        eq(run_bzr(['commit', '-m', 'initial tree']), 0)
 
91
        
 
92
        inv = b.get_revision_inventory(b.lookup_revision(1))
 
93
        
 
94
        eq(len(inv), 4)   # including root
 
95
 
 
96
        file('toplevel', 'w').write('top level file')
 
97
        chdir('src')
 
98
        file('more.c', 'w').write('more content')
 
99
        eq(run_bzr(['add']), 0)
 
100
        
 
101
        ass(b.inventory.path2id('src/more.c'))
 
102
        eq(list(b.unknowns()), ['toplevel'])
87
103
 
88
104
 
89
105
TEST_CLASSES = [