~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_add.py

  • Committer: Robert Collins
  • Date: 2005-12-15 03:21:11 UTC
  • mfrom: (1185.56.2 fixes)
  • Revision ID: robertc@robertcollins.net-20051215032111-e68d5e6ffbd4b574
* Raise NoSuchFile when someone tries to add a non-existant file.
  (Michael Ellerman)

* Simplify handling of DivergedBranches in cmd_pull().
  (Michael Ellerman)

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, Inventory
8
8
from bzrlib.workingtree import WorkingTree
9
9
 
85
85
        self.capture('add --dry-run .')
86
86
        eq(list(t.unknowns()), ['inertiatic'])
87
87
 
 
88
    def test_add_non_existant(self):
 
89
        """Test smart-adding a file that does not exist."""
 
90
        from bzrlib.add import smart_add
 
91
        branch = Branch.initialize(u".")
 
92
        self.assertRaises(NoSuchFile, smart_add, 'non-existant-file')
 
93
 
 
94
 
88
95
class TestSmartAddBranch(TestCaseInTempDir):
89
96
    """Test smart adds with a specified branch."""
90
97