~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_smart_add.py

  • Committer: Samuel Bronson
  • Date: 2012-08-30 20:36:18 UTC
  • mto: (6015.57.3 2.4)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: naesten@gmail.com-20120830203618-y2dzw91nqpvpgxvx
Update INSTALL for switch to Python 2.6 and up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    ignores,
26
26
    osutils,
27
27
    tests,
28
 
    trace,
29
28
    )
30
29
from bzrlib.tests import (
31
 
    features,
 
30
    test_smart_add,
32
31
    per_workingtree,
33
 
    test_smart_add,
34
32
    )
35
33
 
36
34
 
92
90
        for path in paths:
93
91
            self.assertNotEqual(wt.path2id(path), None)
94
92
 
95
 
    def test_skip_nested_trees(self):
96
 
        """Test smart-adding a nested tree ignors it and warns."""
97
 
        wt = self.make_branch_and_tree('.')
98
 
        nested_wt = self.make_branch_and_tree('nested')
99
 
        warnings = []
100
 
        def warning(*args):
101
 
            warnings.append(args[0] % args[1:])
102
 
        self.overrideAttr(trace, 'warning', warning)
103
 
        wt.smart_add((u".",))
104
 
        self.assertIs(wt.path2id("nested"), None)
105
 
        self.assertEquals(
106
 
            ['skipping nested tree %r' % nested_wt.basedir], warnings)
107
 
 
108
93
    def test_add_dot_from_subdir(self):
109
94
        """Test adding . from a subdir of the tree."""
110
95
        paths = ("original/", "original/file1", "original/file2")
164
149
        self.build_tree(tree_shape)
165
150
        wt.smart_add(add_paths)
166
151
        for path in expected_paths:
167
 
            self.assertNotEqual(wt.path2id(path), None,
168
 
                "No id added for %s" % path)
 
152
            self.assertNotEqual(wt.path2id(path), None, "No id added for %s" % path)
169
153
 
170
154
    def test_add_non_existant(self):
171
155
        """Test smart-adding a file that does not exist."""
304
288
 
305
289
class TestSmartAddTreeUnicode(per_workingtree.TestCaseWithWorkingTree):
306
290
 
307
 
    _test_needs_features = [features.UnicodeFilenameFeature]
 
291
    _test_needs_features = [tests.UnicodeFilenameFeature]
308
292
 
309
293
    def setUp(self):
310
294
        super(TestSmartAddTreeUnicode, self).setUp()