~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:06:37 UTC
  • Revision ID: mbp@sourcefrog.net-20050723140637-c9bf049e0e11ea05
- start adding tests for commit in subdir
- change _parse_master_args to not strip off argv[0] 
  so that it's easier to call these from white-box
  tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        from bzrlib.commands import run_bzr
27
27
        import os
28
28
 
29
 
        run_bzr(['bzr', 'init'])
30
 
        run_bzr(['bzr', 'mkdir', 'foo'])
 
29
        run_bzr(['init'])
 
30
        run_bzr(['mkdir', 'foo'])
31
31
        self.assert_(os.path.isdir('foo'))
32
32
 
33
 
        self.assertRaises(OSError, run_bzr, ['bzr', 'mkdir', 'foo'])
 
33
        self.assertRaises(OSError, run_bzr, ['mkdir', 'foo'])
34
34
 
35
35
        from bzrlib.diff import compare_trees, TreeDelta
36
36
        from bzrlib.branch import Branch
64
64
                          b.add,
65
65
                          'foo/hello')
66
66
        
 
67
        
 
68
class SubdirCommit(InTempDir):
 
69
    def runTest(self):
 
70
        """Various commits from a subdirectory"""
 
71
        
 
72
        from bzrlib.branch import Branch
 
73
        from bzrlib.commands import run_bzr
 
74
        import os
 
75
        
 
76
        b = Branch('.', init=True)
 
77
        self.build_tree(['src/', 'src/foo.c', 'README'])
 
78
        
 
79
        self.assertEqual(sorted(b.unknowns()),
 
80
                         ['README', 'src'])
 
81
        
 
82
        self.assertEqual(run_bzr(['version']), 0)
 
83
        
 
84
        self.assertEqual(run_bzr(['add']), 0)
 
85
        
 
86
        
67
87
 
68
88
 
69
89
TEST_CLASSES = [