~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_shelf_ui.py

  • Committer: Aaron Bentley
  • Date: 2008-11-15 20:37:36 UTC
  • mto: This revision was merged to the branch mainline in revision 3838.
  • Revision ID: aaron@aaronbentley.com-20081115203736-6ikutv274y59s0jo
Shelf supports multiple diff writers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
from cStringIO import StringIO
19
19
import os
 
20
import sys
20
21
 
21
22
from bzrlib import errors, shelf_ui, tests
22
23
 
24
25
class ExpectShelver(shelf_ui.Shelver):
25
26
    """A variant of Shelver that intercepts console activity, for testing."""
26
27
 
27
 
    def __init__(self, work_tree, target_tree, path=None, auto=False,
28
 
                 auto_apply=False, file_list=None, message=None):
29
 
        shelf_ui.Shelver.__init__(self, work_tree, target_tree, auto,
30
 
                                  auto_apply, file_list, message)
 
28
    def __init__(self, work_tree, target_tree, diff_writer=None, path=None,
 
29
                 auto=False, auto_apply=False, file_list=None, message=None):
 
30
        shelf_ui.Shelver.__init__(self, work_tree, target_tree, diff_writer,
 
31
                                  auto, auto_apply, file_list, message)
31
32
        self.expected = []
32
33
        self.diff_writer = StringIO()
33
34
 
178
179
 
179
180
    def test_shelve_all(self):
180
181
        tree = self.create_shelvable_tree()
181
 
        ExpectShelver.from_args(all=True, directory='tree').run()
 
182
        ExpectShelver.from_args(sys.stdout, all=True, directory='tree').run()
182
183
        self.assertFileEqual(LINES_AJ, 'tree/foo')
183
184
 
184
185
    def test_shelve_filename(self):