~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tests/test_serialize_transform.py

  • Committer: Aaron Bentley
  • Date: 2008-10-05 06:00:52 UTC
  • mto: (0.15.1 unshelve)
  • mto: This revision was merged to the branch mainline in revision 3820.
  • Revision ID: aaron@aaronbentley.com-20081005060052-sbudbn3fz9sr1158
Support serializing/deserializing directories

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
        tt = transform.TransformPreview(tree)
28
28
        self.addCleanup(tt.finalize)
29
29
        tt.new_file(u'foo\u1234', tt.root, 'bar', 'baz', True)
 
30
        tt.new_directory('qux', tt.root, 'quxx')
30
31
        output = serialize(tt)
31
32
        tt2 = transform.TransformPreview(tree)
32
33
        deserialize(tt2, output)
33
 
        self.assertEqual(2, tt2._id_number)
34
 
        self.assertEqual({'new-1': u'foo\u1234'}, tt2._new_name)
35
 
        self.assertEqual({'new-1': 'baz'}, tt2._new_id)
36
 
        self.assertEqual({'new-1': tt.root}, tt2._new_parent)
37
 
        self.assertEqual({'baz': 'new-1'}, tt2._r_new_id)
38
 
        self.assertEqual({'new-1': 'file'}, tt2._new_contents)
 
34
        self.assertEqual(3, tt2._id_number)
 
35
        self.assertEqual({'new-1': u'foo\u1234',
 
36
                          'new-2': 'qux'}, tt2._new_name)
 
37
        self.assertEqual({'new-1': 'baz', 'new-2': 'quxx'}, tt2._new_id)
 
38
        self.assertEqual({'new-1': tt.root, 'new-2': tt.root}, tt2._new_parent)
 
39
        self.assertEqual({'baz': 'new-1', 'quxx': 'new-2'}, tt2._r_new_id)
 
40
        self.assertEqual({'new-1': 'file',
 
41
                          'new-2': 'directory'}, tt2._new_contents)
39
42
        foo_limbo = open(tt2._limbo_name('new-1'), 'rb')
40
43
        try:
41
44
            foo_content = foo_limbo.read()