~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2012-01-05 13:02:31 UTC
  • mto: This revision was merged to the branch mainline in revision 6434.
  • Revision ID: v.ladeuil+lp@free.fr-20120105130231-grtl31ovy72doqp9
Cleanup old blackbox tests and then some. Remove os.chdir() calls, caught a few bugs, make sure we don't leave file handles opened.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2009, 2010, 2011 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2009-2012 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
154
154
        new_tree = self.make_branch_and_tree('new')
155
155
        self.build_tree(['new/a', 'new/b/', 'new/b/c', 'd'])
156
156
 
157
 
        os.chdir('new')
158
 
        out, err = self.run_bzr('add --file-ids-from ../base')
 
157
        out, err = self.run_bzr('add --file-ids-from ../base',
 
158
                                working_dir='new')
159
159
        self.assertEqual('', err)
160
160
        self.assertEqualDiff('adding a w/ file id from a\n'
161
161
                             'adding b w/ file id from b\n'
175
175
        new_tree = self.make_branch_and_tree('new')
176
176
        self.build_tree(['new/c', 'new/d'])
177
177
 
178
 
        os.chdir('new')
179
 
        out, err = self.run_bzr('add --file-ids-from ../base/b')
 
178
        out, err = self.run_bzr('add --file-ids-from ../base/b',
 
179
                                working_dir='new')
180
180
        self.assertEqual('', err)
181
181
        self.assertEqualDiff('adding c w/ file id from b/c\n'
182
182
                             'adding d w/ file id from b/d\n',
183
183
                             out)
184
184
 
185
 
        new_tree = new_tree.bzrdir.open_workingtree()
 
185
        new_tree = new_tree.bzrdir.open_workingtree('new')
186
186
        self.assertEqual(base_tree.path2id('b/c'), new_tree.path2id('c'))
187
187
        self.assertEqual(base_tree.path2id('b/d'), new_tree.path2id('d'))
188
188