/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/blackbox/test_status.py

  • Committer: Jelmer Vernooij
  • Date: 2018-07-24 20:32:24 UTC
  • mto: This revision was merged to the branch mainline in revision 7054.
  • Revision ID: jelmer@jelmer.uk-20180724203224-3h7jeutnl8na513m
Fix another 128 tests on python 3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
from ...revisionspec import RevisionSpec
41
41
from ...sixish import (
42
42
    BytesIO,
 
43
    StringIO,
43
44
    PY3,
44
45
    )
45
46
from ...status import show_tree_status
240
241
                ],
241
242
                wt, short=True)
242
243
 
243
 
        tof = BytesIO()
 
244
        tof = StringIO()
244
245
        self.assertRaises(errors.PathsDoNotExist,
245
246
                          show_tree_status,
246
247
                          wt, specific_files=['bye.c', 'test.c', 'absent.c'],
247
248
                          to_file=tof)
248
249
 
249
 
        tof = BytesIO()
 
250
        tof = StringIO()
250
251
        show_tree_status(wt, specific_files=['directory'], to_file=tof)
251
252
        tof.seek(0)
252
253
        self.assertEqual(tof.readlines(),
253
254
                          ['unknown:\n',
254
255
                           '  directory/hello.c\n'
255
256
                           ])
256
 
        tof = BytesIO()
 
257
        tof = StringIO()
257
258
        show_tree_status(wt, specific_files=['directory'], to_file=tof,
258
259
                         short=True)
259
260
        tof.seek(0)
260
261
        self.assertEqual(tof.readlines(), ['?   directory/hello.c\n'])
261
262
 
262
 
        tof = BytesIO()
 
263
        tof = StringIO()
263
264
        show_tree_status(wt, specific_files=['dir2'], to_file=tof)
264
265
        tof.seek(0)
265
266
        self.assertEqual(tof.readlines(),
266
267
                          ['unknown:\n',
267
268
                           '  dir2/\n'
268
269
                           ])
269
 
        tof = BytesIO()
 
270
        tof = StringIO()
270
271
        show_tree_status(wt, specific_files=['dir2'], to_file=tof, short=True)
271
272
        tof.seek(0)
272
273
        self.assertEqual(tof.readlines(), ['?   dir2/\n'])
273
274
 
274
 
        tof = BytesIO()
 
275
        tof = StringIO()
275
276
        revs = [RevisionSpec.from_string('0'), RevisionSpec.from_string('1')]
276
277
        show_tree_status(wt, specific_files=['test.c'], to_file=tof,
277
278
                         short=True, revision=revs)
278
279
        tof.seek(0)
279
280
        self.assertEqual(tof.readlines(), ['+N  test.c\n'])
280
281
 
281
 
        tof = BytesIO()
 
282
        tof = StringIO()
282
283
        show_tree_status(wt, specific_files=['missing.c'], to_file=tof)
283
284
        tof.seek(0)
284
285
        self.assertEqual(tof.readlines(),
285
286
                          ['missing:\n',
286
287
                           '  missing.c\n'])
287
288
 
288
 
        tof = BytesIO()
 
289
        tof = StringIO()
289
290
        show_tree_status(wt, specific_files=['missing.c'], to_file=tof,
290
291
                         short=True)
291
292
        tof.seek(0)
304
305
        self.assertEqualDiff(b'', tof.getvalue())
305
306
        tree.set_conflicts(conflicts.ConflictList(
306
307
            [conflicts.ContentsConflict('dir2')]))
307
 
        tof = BytesIO()
 
308
        tof = StringIO()
308
309
        show_tree_status(tree, specific_files=['dir2'], to_file=tof)
309
310
        self.assertEqualDiff(b'conflicts:\n  Contents conflict in dir2\n',
310
311
                             tof.getvalue())
311
312
 
312
313
        tree.set_conflicts(conflicts.ConflictList(
313
314
            [conflicts.ContentsConflict('dir2/file1')]))
314
 
        tof = BytesIO()
 
315
        tof = StringIO()
315
316
        show_tree_status(tree, specific_files=['dir2'], to_file=tof)
316
317
        self.assertEqualDiff(b'conflicts:\n  Contents conflict in dir2/file1\n',
317
318
                             tof.getvalue())