1250
1250
new_text = self.get_raw(StringIO(''.join(bundle_txt)))
1251
1251
new_text = new_text.replace('<file file_id="exe-1"',
1252
1252
'<file executable="y" file_id="exe-1"')
1253
new_text = new_text.replace('B372', 'B387')
1253
new_text = new_text.replace('B222', 'B237')
1254
1254
bundle_txt = StringIO()
1255
1255
bundle_txt.write(serializer._get_bundle_header('4'))
1256
1256
bundle_txt.write('\n')
1459
1459
'storage_kind':'fulltext'}, 'file', 'revid', 'fileid')
1461
1461
fileobj.seek(0)
1462
record_iter = v4.BundleReader(fileobj).iter_records()
1462
reader = v4.BundleReader(fileobj, stream_input=True)
1463
record_iter = reader.iter_records()
1464
record = record_iter.next()
1465
self.assertEqual((None, {'foo': 'bar', 'storage_kind': 'header'},
1466
'info', None, None), record)
1467
record = record_iter.next()
1468
self.assertEqual(("Record body", {'storage_kind': 'fulltext',
1469
'parents': ['1', '3']}, 'file', 'revid', 'fileid'),
1472
def test_roundtrip_record_memory_hungry(self):
1473
fileobj = StringIO()
1474
writer = v4.BundleWriter(fileobj)
1476
writer.add_info_record(foo='bar')
1477
writer._add_record("Record body", {'parents': ['1', '3'],
1478
'storage_kind':'fulltext'}, 'file', 'revid', 'fileid')
1481
reader = v4.BundleReader(fileobj, stream_input=False)
1482
record_iter = reader.iter_records()
1463
1483
record = record_iter.next()
1464
1484
self.assertEqual((None, {'foo': 'bar', 'storage_kind': 'header'},
1465
1485
'info', None, None), record)