/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/test_bad_files.py

  • Committer: Breezy landing bot
  • Author(s): Colin Watson
  • Date: 2020-11-16 21:47:08 UTC
  • mfrom: (7521.1.1 remove-lp-workaround)
  • Revision ID: breezy.the.bot@gmail.com-20201116214708-jos209mgxi41oy15
Remove breezy.git workaround for bazaar.launchpad.net.

Merged from https://code.launchpad.net/~cjwatson/brz/remove-lp-workaround/+merge/393710

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Tests being able to ignore bad filetypes."""
19
19
 
20
 
from cStringIO import StringIO
 
20
from io import StringIO
21
21
import os
22
22
 
23
 
from bzrlib import (
 
23
from .. import (
24
24
    errors,
25
25
    )
26
 
from bzrlib.status import show_tree_status
27
 
from bzrlib.tests import TestCaseWithTransport
28
 
from bzrlib.tests.features import (
 
26
from ..status import show_tree_status
 
27
from . import TestCaseWithTransport
 
28
from .features import (
29
29
    OsFifoFeature,
30
30
    )
31
31
 
48
48
        b = wt.branch
49
49
 
50
50
        files = ['one', 'two', 'three']
51
 
        file_ids = ['one-id', 'two-id', 'three-id']
 
51
        file_ids = [b'one-id', b'two-id', b'three-id']
52
52
        self.build_tree(files)
53
53
        wt.add(files, file_ids)
54
 
        wt.commit("Commit one", rev_id="a@u-0-0")
 
54
        wt.commit("Commit one", rev_id=b"a@u-0-0")
55
55
 
56
56
        # We should now have a few files, lets try to
57
57
        # put some bogus stuff in the tree
63
63
        self.build_tree(['six'])
64
64
 
65
65
        verify_status(self, wt,
66
 
                          ['unknown:\n',
67
 
                           '  a-fifo\n',
68
 
                           '  six\n'
69
 
                           ])
 
66
                      ['unknown:\n',
 
67
                       '  a-fifo\n',
 
68
                       '  six\n'
 
69
                       ])
70
70
 
71
71
        # We should raise an error if we are adding a bogus file
72
72
        self.assertRaises(errors.BadFileKindError, wt.smart_add, ['a-fifo'])
73
73
 
74
74
        # And the list of files shouldn't have been modified
75
75
        verify_status(self, wt,
76
 
                          ['unknown:\n',
77
 
                           '  a-fifo\n',
78
 
                           '  six\n'
79
 
                           ])
 
76
                      ['unknown:\n',
 
77
                       '  a-fifo\n',
 
78
                       '  six\n'
 
79
                       ])
80
80
 
81
81
        # Make sure smart_add can handle having a bogus
82
82
        # file in the way
83
83
        wt.smart_add([])
84
84
        verify_status(self, wt,
85
 
                          ['added:\n',
86
 
                           '  six\n',
87
 
                           'unknown:\n',
88
 
                           '  a-fifo\n',
89
 
                           ])
90
 
        wt.commit("Commit four", rev_id="a@u-0-3")
 
85
                      ['added:\n',
 
86
                       '  six\n',
 
87
                       'unknown:\n',
 
88
                       '  a-fifo\n',
 
89
                       ])
 
90
        wt.commit("Commit four", rev_id=b"a@u-0-3")
91
91
 
92
92
        verify_status(self, wt,
93
 
                          ['unknown:\n',
94
 
                           '  a-fifo\n',
95
 
                           ])
 
93
                      ['unknown:\n',
 
94
                       '  a-fifo\n',
 
95
                       ])