~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests.py

  • Committer: Michael Ellerman
  • Date: 2006-05-30 17:20:21 UTC
  • mto: (0.3.1 shelf-dev)
  • mto: This revision was merged to the branch mainline in revision 393.
  • Revision ID: michael@ellerman.id.au-20060530172021-42c65cc2ffa9cfd2
Make the patch argument to 'shelf show' optional.

If no patch is specified the topmost (ie. most recent) patch is shown.

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
        shown = self.capture('shelf show 00', retcode=0)
170
170
        self.assertEqual(shown, shelf)
171
171
 
 
172
    def test_shelf_show_unspecified(self):
 
173
        self.tree = self.make_branch_and_tree('.')
 
174
        self.__create_and_add_test_file()
 
175
        self.__test_show(self.tree, '00')
 
176
        self.__test_show(self.tree, '01')
 
177
        self.__test_show(self.tree, '02')
 
178
 
 
179
        # Check that not specifying at patch gets us the most recent
 
180
        shelf = open(os.path.join(self.tree.branch.base,
 
181
                    '.shelf/shelves/default/02')).read()
 
182
        self.assertTrue('patch 02' in shelf)
 
183
 
 
184
        # Check the shown output is right
 
185
        shown = self.capture('shelf show', retcode=0)
 
186
        self.assertEqual(shown, shelf)
 
187
 
172
188
    def test_shelf_show_with_no_patch(self):
173
189
        self.tree = self.make_branch_and_tree('.')
174
190
        stderr = self.run_bzr_captured(['shelf', 'show', '00'], retcode=None)[1]