~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2011-05-11 11:35:28 UTC
  • mto: This revision was merged to the branch mainline in revision 5851.
  • Revision ID: john@arbash-meinel.com-20110511113528-qepibuwxicjrbb2h
Break compatibility with python <2.6.

This includes auditing the code for places where we were doing
explicit 'sys.version' checks and removing them as appropriate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2009, 2010, 2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
26
26
from bzrlib.tests import (
27
27
    script,
28
28
    )
29
 
 
30
 
 
31
 
def load_tests(standard_tests, module, loader):
32
 
    """Parameterize tests for view-aware vs not."""
33
 
    to_adapt, result = tests.split_suite_by_condition(
34
 
        standard_tests, tests.condition_isinstance(TestAdd))
 
29
from bzrlib.tests.scenarios import load_tests_apply_scenarios
 
30
 
 
31
 
 
32
load_tests = load_tests_apply_scenarios
 
33
 
 
34
 
 
35
class TestAdd(tests.TestCaseWithTransport):
 
36
 
35
37
    scenarios = [
36
38
        ('pre-views', {'branch_tree_format': 'pack-0.92'}),
37
 
        ('view-aware', {'branch_tree_format': 'development6-rich-root'}),
 
39
        ('view-aware', {'branch_tree_format': '2a'}),
38
40
        ]
39
 
    return tests.multiply_tests(to_adapt, scenarios, result)
40
 
 
41
 
 
42
 
class TestAdd(tests.TestCaseWithTransport):
43
41
 
44
42
    def make_branch_and_tree(self, dir):
45
43
        return super(TestAdd, self).make_branch_and_tree(
231
229
        $ bzr add tree1/a tree2/b
232
230
        2>bzr: ERROR: Path "...tree2/b" is not a child of path "...tree1"
233
231
        ''')
 
232
 
 
233
    def test_add_multiple_files_in_unicode_cwd(self):
 
234
        """Adding multiple files in a non-ascii cwd, see lp:686611"""
 
235
        self.requireFeature(tests.UnicodeFilename)
 
236
        self.make_branch_and_tree(u"\xA7")
 
237
        self.build_tree([u"\xA7/a", u"\xA7/b"])
 
238
        out, err = self.run_bzr(["add", "a", "b"], working_dir=u"\xA7")
 
239
        self.assertEquals(out, "adding a\n" "adding b\n")
 
240
        self.assertEquals(err, "")