/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_missing.py

  • Committer: Alexander Belchenko
  • Date: 2007-01-24 13:03:32 UTC
  • mto: This revision was merged to the branch mainline in revision 2242.
  • Revision ID: bialix@ukr.net-20070124130332-ane2eqz3eqrtm9u1
Use new API for testing

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import os
22
22
 
 
23
from bzrlib import osutils
 
24
 
23
25
from bzrlib.branch import Branch
24
 
from bzrlib.tests import TestCaseInTempDir
25
 
 
26
 
 
27
 
class TestMissing(TestCaseInTempDir):
 
26
from bzrlib.tests import TestCaseWithTransport
 
27
 
 
28
 
 
29
class TestMissing(TestCaseWithTransport):
28
30
 
29
31
    def test_missing(self):
30
32
        def bzr(*args, **kwargs):
120
122
 
121
123
    def test_missing_check_last_location(self):
122
124
        # check that last location shown as filepath not file URL
123
 
        def bzr(*args, **kwargs):
124
 
            return self.run_bzr(*args, **kwargs)[0]
125
125
 
126
126
        # create a source branch
127
127
        os.mkdir('a')
128
128
        os.chdir('a')
129
 
        location = os.getcwd().replace('\\','/') + '/'
130
 
        bzr('init')
131
 
        open('a', 'wb').write('initial\n')
132
 
        bzr('add', 'a')
133
 
        bzr('commit', '-m', 'inital')
 
129
        wt = self.make_branch_and_tree('.')
 
130
        b = wt.branch
 
131
        self.build_tree(['foo'])
 
132
        wt.add('foo')
 
133
        wt.commit('initial')
 
134
 
 
135
        location = osutils.getcwd() + '/'
 
136
 
134
137
        # clone
135
 
        bzr('branch', '.', '../b')
136
 
        os.chdir('../b')
 
138
        b.bzrdir.sprout('../b')
137
139
 
138
140
        # check last location
139
 
        lines = bzr('missing')
 
141
        lines, err = self.run_bzr('missing', working_dir='../b')
140
142
        self.assertEquals('Using last location: %s\n'
141
143
                          'Branches are up to date.\n' % location,
142
144
                          lines)
 
145
        self.assertEquals('', err)