~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_xml.py

  • Committer: Vincent Ladeuil
  • Date: 2007-10-23 07:15:13 UTC
  • mfrom: (2926 +trunk)
  • mto: (2961.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2962.
  • Revision ID: v.ladeuil+lp@free.fr-20071023071513-elryt6g2at34d2ur
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
</inventory>
176
176
"""
177
177
 
 
178
# Before revision_id was always stored as an attribute
 
179
_inventory_v5a = """<inventory format="5">
 
180
</inventory>
 
181
"""
 
182
 
 
183
# Before revision_id was always stored as an attribute
 
184
_inventory_v5b = """<inventory format="5" revision_id="a-rev-id">
 
185
</inventory>
 
186
"""
 
187
 
178
188
 
179
189
class TestSerializer(TestCase):
180
190
    """Test XML serialization"""
247
257
        eq(ie.name, 'bar')
248
258
        eq(inv[ie.parent_id].kind, 'directory')
249
259
 
 
260
    def test_unpack_inventory_5a(self):
 
261
        inv = bzrlib.xml5.serializer_v5.read_inventory_from_string(
 
262
                _inventory_v5a, revision_id='test-rev-id')
 
263
        self.assertEqual('test-rev-id', inv.root.revision)
 
264
 
 
265
    def test_unpack_inventory_5b(self):
 
266
        inv = bzrlib.xml5.serializer_v5.read_inventory_from_string(
 
267
                _inventory_v5b, revision_id='test-rev-id')
 
268
        self.assertEqual('a-rev-id', inv.root.revision)
 
269
 
250
270
    def test_repack_inventory_5(self):
251
271
        inp = StringIO(_committed_inv_v5)
252
272
        inv = bzrlib.xml5.serializer_v5.read_inventory(inp)