~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_add.py

  • Committer: Michael Ellerman
  • Date: 2005-12-10 22:11:46 UTC
  • mto: This revision was merged to the branch mainline in revision 1528.
  • Revision ID: michael@ellerman.id.au-20051210221145-7765347ea4ca0093
Raise NoSuchFile when someone tries to add a non-existant file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
from bzrlib.tests import TestCaseInTempDir, TestCase
5
5
from bzrlib.branch import Branch
6
 
from bzrlib.errors import NotBranchError
 
6
from bzrlib.errors import NotBranchError, NoSuchFile
7
7
from bzrlib.inventory import InventoryFile
8
8
from bzrlib.workingtree import WorkingTree
9
9
 
74
74
        smart_add(paths)
75
75
        for path in paths:
76
76
            self.assertNotEqual(branch.working_tree().path2id(path), None)
77
 
            
 
77
 
 
78
    def test_add_non_existant(self):
 
79
        """Test smart-adding a file that does not exist."""
 
80
        from bzrlib.add import smart_add
 
81
        branch = Branch.initialize(u".")
 
82
        self.assertRaises(NoSuchFile, smart_add, 'non-existant-file')
 
83
 
78
84
class TestSmartAddBranch(TestCaseInTempDir):
79
85
    """Test smart adds with a specified branch."""
80
86