~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_shelf.py

  • Committer: Parth Malwankar
  • Date: 2010-09-14 13:30:59 UTC
  • mto: This revision was merged to the branch mainline in revision 5444.
  • Revision ID: parth.malwankar@gmail.com-20100914133059-sbinds654gqiowze
added test_list_shelves

Show diffs side-by-side

added added

removed removed

Lines of Context:
740
740
        metadata = shelf_manager.get_metadata(shelf_id)
741
741
        self.assertEqual('foo', metadata['message'])
742
742
        self.assertEqual('null:', metadata['revision_id'])
 
743
 
 
744
    def test_list_shelves(self):
 
745
        """Ensure shelf.list_shelves() works correctly.
 
746
        """
 
747
        tree = self.make_branch_and_tree('tree')
 
748
        tree.commit('no-change commit')
 
749
        tree.lock_write()
 
750
        self.addCleanup(tree.unlock)
 
751
        self.build_tree_contents([('tree/foo', 'bar')])
 
752
        tree.add('foo', 'foo-id')
 
753
        creator = shelf.ShelfCreator(tree, tree.basis_tree())
 
754
        self.addCleanup(creator.finalize)
 
755
        shelf_manager = tree.get_shelf_manager()
 
756
        self.assertEqual([], shelf.list_shelves(tree))
 
757
        shelf_id = shelf_manager.shelve_changes(creator)
 
758
        self.assertEqual([(1, '<no message>')], shelf.list_shelves(tree))
 
759