~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Wouter van Heyst
  • Date: 2006-06-07 16:05:27 UTC
  • mto: This revision was merged to the branch mainline in revision 1752.
  • Revision ID: larstiq@larstiq.dyndns.org-20060607160527-2b3649154d0e2e84
more code cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 Canonical Ltd
 
1
# Copyright (C) 2005 by Canonical Ltd
2
2
# -*- coding: utf-8 -*-
3
3
# vim: encoding=utf-8
4
 
#
 
4
 
5
5
# This program is free software; you can redistribute it and/or modify
6
6
# it under the terms of the GNU General Public License as published by
7
7
# the Free Software Foundation; either version 2 of the License, or
8
8
# (at your option) any later version.
9
 
#
 
9
 
10
10
# This program is distributed in the hope that it will be useful,
11
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
13
# GNU General Public License for more details.
14
 
#
 
14
 
15
15
# You should have received a copy of the GNU General Public License
16
16
# along with this program; if not, write to the Free Software
17
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 
 
19
 
"""Black-box tests for bzr missing."""
 
18
"""Black-box tests for bzr missing.
 
19
"""
20
20
 
21
21
import os
22
22
 
23
 
from bzrlib import osutils
24
 
 
25
23
from bzrlib.branch import Branch
26
 
from bzrlib.tests import TestCaseWithTransport
27
 
 
28
 
 
29
 
class TestMissing(TestCaseWithTransport):
 
24
from bzrlib.tests import TestCaseInTempDir
 
25
 
 
26
 
 
27
class TestMissing(TestCaseInTempDir):
30
28
 
31
29
    def test_missing(self):
32
30
        def bzr(*args, **kwargs):
120
118
        self.assertEqual("Branches are up to date.\n", 
121
119
                         bzr('missing', '../a'))
122
120
 
123
 
    def test_missing_check_last_location(self):
124
 
        # check that last location shown as filepath not file URL
125
 
 
126
 
        # create a source branch
127
 
        os.mkdir('a')
128
 
        os.chdir('a')
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
 
 
137
 
        # clone
138
 
        b.bzrdir.sprout('../b')
139
 
 
140
 
        # check last location
141
 
        lines, err = self.run_bzr('missing', working_dir='../b')
142
 
        self.assertEquals('Using last location: %s\n'
143
 
                          'Branches are up to date.\n' % location,
144
 
                          lines)
145
 
        self.assertEquals('', err)