~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_add.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-03 16:19:30 UTC
  • mfrom: (1836 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1851.
  • Revision ID: john@arbash-meinel.com-20060703161930-c373bd7eddd73011
[merge] bzr.dev 1836

Show diffs side-by-side

added added

removed removed

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