~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

Merge in knit repository use of knits - still not a stable format, but can be experimented with.

Show diffs side-by-side

added added

removed removed

Lines of Context:
231
231
        self.assertRaises(FileExists, t.mkdir, 'dir_g')
232
232
 
233
233
        # Test get/put in sub-directories
234
 
        self.assertEqual(
 
234
        self.assertEqual(2, 
235
235
            t.put_multi([('dir_a/a', StringIO('contents of dir_a/a')),
236
 
                         ('dir_b/b', StringIO('contents of dir_b/b'))])
237
 
                        , 2)
 
236
                         ('dir_b/b', StringIO('contents of dir_b/b'))]))
238
237
        self.check_transport_contents('contents of dir_a/a', t, 'dir_a/a')
239
238
        self.check_transport_contents('contents of dir_b/b', t, 'dir_b/b')
240
239
 
268
267
        def simple_copy_files(transport_from, transport_to):
269
268
            files = ['a', 'b', 'c', 'd']
270
269
            self.build_tree(files, transport=transport_from)
271
 
            transport_from.copy_to(files, transport_to)
 
270
            self.assertEqual(4, transport_from.copy_to(files, transport_to))
272
271
            for f in files:
273
272
                self.check_transport_contents(transport_to.get(f).read(),
274
273
                                              transport_from, f)
326
325
                    t.append, 'a', 'add\nsome\nmore\ncontents\n')
327
326
            _append('a', StringIO('add\nsome\nmore\ncontents\n'))
328
327
        else:
329
 
            t.append('a', StringIO('add\nsome\nmore\ncontents\n'))
 
328
            self.assertEqual(20,
 
329
                t.append('a', StringIO('add\nsome\nmore\ncontents\n')))
330
330
 
331
331
        self.check_transport_contents(
332
332
            'diff\ncontents for\na\nadd\nsome\nmore\ncontents\n',
340
340
            _append('a', StringIO('and\nthen\nsome\nmore\n'))
341
341
            _append('b', StringIO('some\nmore\nfor\nb\n'))
342
342
        else:
343
 
            t.append_multi([('a', StringIO('and\nthen\nsome\nmore\n')),
344
 
                    ('b', StringIO('some\nmore\nfor\nb\n'))])
 
343
            self.assertEqual((43, 15), 
 
344
                t.append_multi([('a', StringIO('and\nthen\nsome\nmore\n')),
 
345
                                ('b', StringIO('some\nmore\nfor\nb\n'))]))
345
346
        self.check_transport_contents(
346
347
            'diff\ncontents for\na\n'
347
348
            'add\nsome\nmore\ncontents\n'
356
357
            _append('a', StringIO('a little bit more\n'))
357
358
            _append('b', StringIO('from an iterator\n'))
358
359
        else:
359
 
            t.append_multi(iter([('a', StringIO('a little bit more\n')),
360
 
                    ('b', StringIO('from an iterator\n'))]))
 
360
            self.assertEqual((62, 31),
 
361
                t.append_multi(iter([('a', StringIO('a little bit more\n')),
 
362
                                     ('b', StringIO('from an iterator\n'))])))
361
363
        self.check_transport_contents(
362
364
            'diff\ncontents for\na\n'
363
365
            'add\nsome\nmore\ncontents\n'
375
377
            _append('a', StringIO('some text in a\n'))
376
378
            _append('d', StringIO('missing file r\n'))
377
379
        else:
378
 
            t.append('c', StringIO('some text\nfor a missing file\n'))
379
 
            t.append_multi([('a', StringIO('some text in a\n')),
380
 
                            ('d', StringIO('missing file r\n'))])
 
380
            self.assertEqual(0,
 
381
                t.append('c', StringIO('some text\nfor a missing file\n')))
 
382
            self.assertEqual((80, 0),
 
383
                t.append_multi([('a', StringIO('some text in a\n')),
 
384
                                ('d', StringIO('missing file r\n'))]))
381
385
        self.check_transport_contents(
382
386
            'diff\ncontents for\na\n'
383
387
            'add\nsome\nmore\ncontents\n'