~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tests/test_prepare_shelf.py

  • Committer: Aaron Bentley
  • Date: 2008-10-06 20:05:01 UTC
  • mto: (0.16.3 shelf-ui)
  • mto: This revision was merged to the branch mainline in revision 3820.
  • Revision ID: aaron@aaronbentley.com-20081006200501-fqft11edzly8mlcr
Add failing test of unshelver

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
        tt = transform.TransformPreview(tree)
147
147
        serialize_transform.deserialize(tt,
148
148
            iter(parser.read_pending_records()))
 
149
 
 
150
 
 
151
class TestUnshelver(tests.TestCaseWithTransport):
 
152
 
 
153
    def test_unshelve(self):
 
154
        tree = self.make_branch_and_tree('tree')
 
155
        self.build_tree_contents([('tree/foo', 'bar')])
 
156
        tree.add('foo', 'foo-id')
 
157
        creator = prepare_shelf.ShelfCreator(tree, tree.basis_tree())
 
158
        list(creator)
 
159
        creator.shelve_creation('foo-id', 'file')
 
160
        creator.transform()
 
161
        filename = creator.write_shelf()
 
162
        unshelver = prepare_shelf.Unshelver.from_tree_and_shelf(tree, filename)
 
163
        unshelver.unshelve()
 
164
        self.assertFileEqual('bar', 'tree/foo')