~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: abentley
  • Date: 2006-04-20 23:47:53 UTC
  • mfrom: (1681 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1683.
  • Revision ID: abentley@lappy-20060420234753-6a6874b76f09f86d
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 by Canonical Ltd
 
1
# Copyright (C) 2005, 2006 by 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
32
32
import bzrlib.branch
33
33
from bzrlib.builtins import merge
34
34
import bzrlib.bzrdir as bzrdir
 
35
import bzrlib.errors as errors
35
36
from bzrlib.osutils import pathjoin
36
37
from bzrlib.revisionspec import RevisionSpec
37
38
from bzrlib.status import show_tree_status
154
155
                           '  directory/hello.c\n'
155
156
                           ])
156
157
 
157
 
        tof = StringIO()
158
 
        show_tree_status(wt, specific_files=['bye.c','test.c','absent.c'], 
159
 
                         to_file=tof)
160
 
        tof.seek(0)
161
 
        self.assertEquals(tof.readlines(),
162
 
                          ['unknown:\n',
163
 
                           '  bye.c\n'
164
 
                           ])
 
158
        self.assertRaises(errors.PathsDoNotExist,
 
159
                          show_tree_status,
 
160
                          wt, specific_files=['bye.c','test.c','absent.c'], 
 
161
                          to_file=tof)
165
162
        
166
163
        tof = StringIO()
167
164
        show_tree_status(wt, specific_files=['directory'], to_file=tof)
178
175
                           '  dir2\n'
179
176
                           ])
180
177
 
 
178
    def test_status_nonexistent_file(self):
 
179
        # files that don't exist in either the basis tree or working tree
 
180
        # should give an error
 
181
        wt = self.make_branch_and_tree('.')
 
182
        out, err = self.run_bzr('status', 'does-not-exist', retcode=3)
 
183
        self.assertContainsRe(err, r'do not exist.*does-not-exist')
 
184
 
 
185
 
181
186
class CheckoutStatus(BranchStatus):
182
187
 
183
188
    def setUp(self):