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

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 12:41:27 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521124127-iv8etg0vwymyai6y
s/bzr/brz/ in apport config.

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 io import StringIO
 
20
from cStringIO import StringIO
21
21
import os
22
22
 
23
 
from .. import (
 
23
from brzlib import (
24
24
    errors,
25
25
    )
26
 
from ..status import show_tree_status
27
 
from . import TestCaseWithTransport
28
 
from .features import (
 
26
from brzlib.status import show_tree_status
 
27
from brzlib.tests import TestCaseWithTransport
 
28
from brzlib.tests.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 = [b'one-id', b'two-id', b'three-id']
 
51
        file_ids = ['one-id', 'two-id', 'three-id']
52
52
        self.build_tree(files)
53
53
        wt.add(files, file_ids)
54
 
        wt.commit("Commit one", rev_id=b"a@u-0-0")
 
54
        wt.commit("Commit one", rev_id="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=b"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="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
                           ])