~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_add.py

  • Committer: Martin Pool
  • Date: 2006-07-03 04:59:44 UTC
  • mfrom: (1765.1.1 ignored)
  • mto: This revision was merged to the branch mainline in revision 1832.
  • Revision ID: mbp@sourcefrog.net-20060703045944-3b6a4e9d2c693b1e
[merge] remove default ignore list & update

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
from bzrlib.add import smart_add, smart_add_tree
5
5
from bzrlib.tests import TestCaseWithTransport, TestCase
6
 
from bzrlib.branch import Branch
7
 
from bzrlib.errors import NotBranchError, NoSuchFile
 
6
from bzrlib.errors import NoSuchFile
8
7
from bzrlib.inventory import InventoryFile, Inventory
9
8
from bzrlib.workingtree import WorkingTree
10
9
 
117
116
        branch = wt.branch
118
117
        self.assertRaises(NoSuchFile, smart_add_tree, wt, 'non-existant-file')
119
118
 
120
 
    def test_returns(self):
 
119
    def test_returns_and_ignores(self):
121
120
        """Correctly returns added/ignored files"""
122
121
        from bzrlib.commands import run_bzr
123
122
        wt = self.make_branch_and_tree('.')
124
123
        branch = wt.branch
 
124
        # no files should be ignored by default, so we need to create
 
125
        # an ignore rule - we create one for the pyc files, which means
 
126
        # CVS should not be ignored.
125
127
        self.build_tree(['inertiatic/', 'inertiatic/esp', 'inertiatic/CVS', 
126
128
                        'inertiatic/foo.pyc'])
 
129
        self.build_tree_contents([('.bzrignore', '*.py[oc]\n')])
127
130
        added, ignored = smart_add_tree(wt, u'.')
128
 
        self.assertSubset(('inertiatic', 'inertiatic/esp'), added)
129
 
        self.assertSubset(('CVS', '*.py[oc]'), ignored)
130
 
        self.assertSubset(('inertiatic/CVS',), ignored['CVS'])
 
131
        self.assertSubset(('inertiatic', 'inertiatic/esp', 'inertiatic/CVS'),
 
132
                          added)
 
133
        self.assertSubset(('*.py[oc]',), ignored)
131
134
        self.assertSubset(('inertiatic/foo.pyc',), ignored['*.py[oc]'])
132
135
 
133
136
 
134
 
class TestSmartAddBranch(TestCaseWithTransport):
 
137
class TestSmartAddTree(TestCaseWithTransport):
135
138
    """Test smart adds with a specified branch."""
136
139
 
137
140
    def test_add_dot_from_root(self):