~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-10-27 16:14:03 UTC
  • mto: This revision was merged to the branch mainline in revision 3823.
  • Revision ID: aaron@aaronbentley.com-20081027161403-m4bkvzi8oyc8aki9
Test finish and quit

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
 
18
18
from cStringIO import StringIO
 
19
import os
19
20
 
20
21
from bzrlib import shelf_ui, tests
21
22
 
118
119
        shelver.expect('Shelve 1 change(s)? [yNfq]', 'y')
119
120
        shelver.run()
120
121
        self.assertFileEqual(LINES_AJ, 'tree/foo')
 
122
 
 
123
    def test_shelve_deletion(self):
 
124
        tree = self.create_shelvable_tree()
 
125
        os.unlink('tree/foo')
 
126
        shelver = ExpectShelver(tree, tree.basis_tree())
 
127
        shelver.expect('Shelve removing file "foo"?  [yNfq]', 'y')
 
128
        shelver.expect('Shelve 1 change(s)? [yNfq]', 'y')
 
129
        shelver.run()
 
130
        self.assertFileEqual(LINES_AJ, 'tree/foo')
 
131
 
 
132
    def test_shelve_finish(self):
 
133
        tree = self.create_shelvable_tree()
 
134
        shelver = ExpectShelver(tree, tree.basis_tree())
 
135
        shelver.expect('Shelve? [yNfq]', 'f')
 
136
        shelver.expect('Shelve 2 change(s)? [yNfq]', 'y')
 
137
        shelver.run()
 
138
        self.assertFileEqual(LINES_AJ, 'tree/foo')
 
139
 
 
140
    def test_shelve_quit(self):
 
141
        tree = self.create_shelvable_tree()
 
142
        shelver = ExpectShelver(tree, tree.basis_tree())
 
143
        shelver.expect('Shelve? [yNfq]', 'q')
 
144
        self.assertRaises(SystemExit, shelver.run)
 
145
        self.assertFileEqual(LINES_ZY, 'tree/foo')