~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_add.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-05-28 07:23:39 UTC
  • mfrom: (5933.1.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20110528072339-sz8zc51i8sv71lgx
sphinx-1.0.7 still has bug #785098 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    tests,
25
25
    )
26
26
from bzrlib.tests import (
27
 
    features,
28
27
    script,
29
28
    )
30
29
from bzrlib.tests.scenarios import load_tests_apply_scenarios
206
205
        self.assertContainsRe(err, r'ERROR:.*\.bzr.*control file')
207
206
 
208
207
    def test_add_via_symlink(self):
209
 
        self.requireFeature(features.SymlinkFeature)
 
208
        self.requireFeature(tests.SymlinkFeature)
210
209
        self.make_branch_and_tree('source')
211
210
        self.build_tree(['source/top.txt'])
212
211
        os.symlink('source', 'link')
214
213
        self.assertEquals(out, 'adding top.txt\n')
215
214
 
216
215
    def test_add_symlink_to_abspath(self):
217
 
        self.requireFeature(features.SymlinkFeature)
 
216
        self.requireFeature(tests.SymlinkFeature)
218
217
        self.make_branch_and_tree('tree')
219
218
        os.symlink(osutils.abspath('target'), 'tree/link')
220
219
        out = self.run_bzr(['add', 'tree/link'])[0]
233
232
 
234
233
    def test_add_multiple_files_in_unicode_cwd(self):
235
234
        """Adding multiple files in a non-ascii cwd, see lp:686611"""
236
 
        self.requireFeature(features.UnicodeFilenameFeature)
 
235
        self.requireFeature(tests.UnicodeFilename)
237
236
        self.make_branch_and_tree(u"\xA7")
238
237
        self.build_tree([u"\xA7/a", u"\xA7/b"])
239
238
        out, err = self.run_bzr(["add", "a", "b"], working_dir=u"\xA7")
240
239
        self.assertEquals(out, "adding a\n" "adding b\n")
241
240
        self.assertEquals(err, "")
242
 
        
243
 
    def test_add_skip_large_files(self):
244
 
        """Test skipping files larger than add.maximum_file_size"""
245
 
        tree = self.make_branch_and_tree('.')
246
 
        self.build_tree(['small.txt', 'big.txt', 'big2.txt'])
247
 
        self.build_tree_contents([('small.txt', '0\n')])
248
 
        self.build_tree_contents([('big.txt', '01234567890123456789\n')])
249
 
        self.build_tree_contents([('big2.txt', '01234567890123456789\n')])
250
 
        tree.branch.get_config().set_user_option('add.maximum_file_size', 5)
251
 
        out = self.run_bzr('add')[0]
252
 
        results = sorted(out.rstrip('\n').split('\n'))
253
 
        self.assertEquals(['adding small.txt'], 
254
 
                          results)
255
 
        # named items never skipped, even if over max
256
 
        out, err = self.run_bzr(["add", "big2.txt"])
257
 
        results = sorted(out.rstrip('\n').split('\n'))
258
 
        self.assertEquals(['adding big2.txt'], 
259
 
                          results)
260
 
        self.assertEquals(err, "")
261
 
        tree.branch.get_config().set_user_option('add.maximum_file_size', 30)
262
 
        out = self.run_bzr('add')[0]
263
 
        results = sorted(out.rstrip('\n').split('\n'))
264
 
        self.assertEquals(['adding big.txt'], 
265
 
                          results)