~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-17 08:40:16 UTC
  • mfrom: (5642.4.6 712474-module-available)
  • Revision ID: pqm@pqm.ubuntu.com-20110817084016-600z65qzqmmt44w7
(vila) ModuleAvailableFeature don't try to imported already imported
 modules. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2008 Canonical Ltd
 
1
# Copyright (C) 2005-2010 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
113
113
        lines4 = self.run_bzr('missing ../a --short', retcode=1)[0]
114
114
        lines4 = lines4.splitlines()
115
115
        self.assertEqual(4, len(lines4))
 
116
        lines4a = self.run_bzr('missing ../a -S', retcode=1)[0]
 
117
        lines4a = lines4a.splitlines()
 
118
        self.assertEqual(lines4, lines4a)
116
119
        lines5 = self.run_bzr('missing ../a --line', retcode=1)[0]
117
120
        lines5 = lines5.splitlines()
118
121
        self.assertEqual(2, len(lines5))
200
203
                          'Branches are up to date.\n' % location,
201
204
                          lines)
202
205
        self.assertEquals('', err)
 
206
 
 
207
    def test_missing_directory(self):
 
208
        """Test --directory option"""
 
209
 
 
210
        # create a source branch
 
211
        a_tree = self.make_branch_and_tree('a')
 
212
        self.build_tree_contents([('a/a', 'initial\n')])
 
213
        a_tree.add('a')
 
214
        a_tree.commit(message='initial')
 
215
 
 
216
        # clone and add a differing revision
 
217
        b_tree = a_tree.bzrdir.sprout('b').open_workingtree()
 
218
        self.build_tree_contents([('b/a', 'initial\nmore\n')])
 
219
        b_tree.commit(message='more')
 
220
        
 
221
        out2, err2 = self.run_bzr('missing --directory a b', retcode=1)
 
222
        os.chdir('a')
 
223
        out1, err1 = self.run_bzr('missing ../b', retcode=1)
 
224
        self.assertEqualDiff(out1, out2)
 
225
        self.assertEqualDiff(err1, err2)