/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2010-12-14 23:39:41 UTC
  • mto: This revision was merged to the branch mainline in revision 5571.
  • Revision ID: mbp@sourcefrog.net-20101214233941-95uq6n9xf0xgtyc3
Code guidelines re exception objects

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    osutils,
24
24
    tests,
25
25
    )
26
 
 
27
 
 
28
 
def load_tests(standard_tests, module, loader):
29
 
    """Parameterize tests for view-aware vs not."""
30
 
    to_adapt, result = tests.split_suite_by_condition(
31
 
        standard_tests, tests.condition_isinstance(TestAdd))
 
26
from bzrlib.tests import (
 
27
    script,
 
28
    )
 
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
 
32
37
    scenarios = [
33
38
        ('pre-views', {'branch_tree_format': 'pack-0.92'}),
34
 
        ('view-aware', {'branch_tree_format': 'development6-rich-root'}),
 
39
        ('view-aware', {'branch_tree_format': '2a'}),
35
40
        ]
36
 
    return tests.multiply_tests(to_adapt, scenarios, result)
37
 
 
38
 
 
39
 
class TestAdd(tests.TestCaseWithTransport):
40
41
 
41
42
    def make_branch_and_tree(self, dir):
42
43
        return super(TestAdd, self).make_branch_and_tree(
217
218
        os.symlink(osutils.abspath('target'), 'tree/link')
218
219
        out = self.run_bzr(['add', 'tree/link'])[0]
219
220
        self.assertEquals(out, 'adding link\n')
 
221
 
 
222
    def test_add_not_child(self):
 
223
        # https://bugs.launchpad.net/bzr/+bug/98735
 
224
        sr = script.ScriptRunner()
 
225
        self.make_branch_and_tree('tree1')
 
226
        self.make_branch_and_tree('tree2')
 
227
        self.build_tree(['tree1/a', 'tree2/b'])
 
228
        sr.run_script(self, '''
 
229
        $ bzr add tree1/a tree2/b
 
230
        2>bzr: ERROR: Path "...tree2/b" is not a child of path "...tree1"
 
231
        ''')