~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/TestUtil.py

  • Committer: Rory Yorke
  • Date: 2010-10-20 14:38:53 UTC
  • mto: This revision was merged to the branch mainline in revision 5519.
  • Revision ID: rory.yorke@gmail.com-20101020143853-9kfd2ldcjfroh8jw
Show missing files in bzr status (bug 134168).

"bzr status" will now show missing files, that is, those added with "bzr
add" and then removed by non bzr means (e.g., rm).

Blackbox tests were added for this case, and tests were also added to
test_delta, since the implementation change is in bzrlib.delta.

Might also affect bug 189709.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#       Author: Robert Collins <robert.collins@canonical.com>
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
29
29
 
30
30
 
31
31
class LogCollector(logging.Handler):
32
 
 
33
32
    def __init__(self):
34
33
        logging.Handler.__init__(self)
35
34
        self.records=[]
36
 
 
37
35
    def emit(self, record):
38
36
        self.records.append(record.getMessage())
39
37
 
62
60
                visitor.visitSuite(test)
63
61
                visitTests(test, visitor)
64
62
            else:
65
 
                print "unvisitable non-unittest.TestCase element %r (%r)" % (
66
 
                    test, test.__class__)
 
63
                print "unvisitable non-unittest.TestCase element %r (%r)" % (test, test.__class__)
67
64
 
68
65
 
69
66
class TestSuite(unittest.TestSuite):
186
183
 
187
184
class TestVisitor(object):
188
185
    """A visitor for Tests"""
189
 
 
190
186
    def visitSuite(self, aTestSuite):
191
187
        pass
192
 
 
193
188
    def visitCase(self, aTestCase):
194
189
        pass