~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/versioning.py

  • Committer: Martin Pool
  • Date: 2005-06-22 08:12:49 UTC
  • Revision ID: mbp@sourcefrog.net-20050622081249-4594759bea53cd37
- new check for attempting to add a file in an unversioned 
  subdirectory

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        self.assertEquals(delta.added[0][0], 'foo')
43
43
        self.failIf(delta.modified)
44
44
 
 
45
 
 
46
 
 
47
class AddInUnversioned(InTempDir):
 
48
    def runTest(self):
 
49
        """Try to add a file in an unversioned directory.
 
50
 
 
51
        smart_add may eventually add the parent as necessary, but simple
 
52
        branch add doesn't do that.
 
53
        """
 
54
        from bzrlib.branch import Branch
 
55
        import os
 
56
        from bzrlib.errors import NotVersionedError
 
57
 
 
58
        b = Branch('.', init=True)
 
59
 
 
60
        self.build_tree(['foo/',
 
61
                         'foo/hello'])
 
62
 
 
63
        self.assertRaises(NotVersionedError,
 
64
                          b.add,
 
65
                          'foo/hello')
 
66