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

  • Committer: Aaron Bentley
  • Date: 2009-03-12 08:08:37 UTC
  • mfrom: (4127 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4130.
  • Revision ID: aaron@aaronbentley.com-20090312080837-e9t05lzj2b6yfr5a
Merge bzr.dev into send-hookage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
class ExpectShelver(shelf_ui.Shelver):
26
26
    """A variant of Shelver that intercepts console activity, for testing."""
27
27
 
28
 
    def __init__(self, work_tree, target_tree, diff_writer=None, path=None,
29
 
                 auto=False, auto_apply=False, file_list=None, message=None):
 
28
    def __init__(self, work_tree, target_tree, diff_writer=None,
 
29
                 auto=False, auto_apply=False, file_list=None, message=None,
 
30
                 destroy=False):
30
31
        shelf_ui.Shelver.__init__(self, work_tree, target_tree, diff_writer,
31
 
                                  auto, auto_apply, file_list, message)
 
32
                                  auto, auto_apply, file_list, message,
 
33
                                  destroy)
32
34
        self.expected = []
33
35
        self.diff_writer = StringIO()
34
36
 
199
201
        shelver.expect('Shelve 2 change(s)? [yNfq?]', 'y')
200
202
        shelver.run()
201
203
 
 
204
    def test_shelve_distroy(self):
 
205
        tree = self.create_shelvable_tree()
 
206
        shelver = shelf_ui.Shelver.from_args(sys.stdout, all=True,
 
207
                                             directory='tree', destroy=True)
 
208
        shelver.run()
 
209
        self.assertIs(None, tree.get_shelf_manager().last_shelf())
 
210
        self.assertFileEqual(LINES_AJ, 'tree/foo')
 
211
 
202
212
 
203
213
class TestUnshelver(tests.TestCaseWithTransport):
204
214