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

  • Committer: Jelmer Vernooij
  • Date: 2018-11-11 04:08:32 UTC
  • mto: (7143.16.20 even-more-cleanups)
  • mto: This revision was merged to the branch mainline in revision 7175.
  • Revision ID: jelmer@jelmer.uk-20181111040832-nsljjynzzwmznf3h
Run autopep8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
        # increase it, then you almost certainly are doing something wrong as
89
89
        # the relationship from working_tree to branch is one way.
90
90
        # Note that this is an exact equality so that when the number drops,
91
 
        #it is not given a buffer but rather has this test updated immediately.
 
91
        # it is not given a buffer but rather has this test updated immediately.
92
92
        self.assertEqual(0, occurences)
93
93
 
94
94
    def test_branch_WorkingTree(self):
205
205
            else:
206
206
                if 'by Canonical' in match.group():
207
207
                    incorrect.append((fname,
208
 
                        'should not have: "by Canonical": %s'
209
 
                        % (match.group(),)))
 
208
                                      'should not have: "by Canonical": %s'
 
209
                                      % (match.group(),)))
210
210
 
211
211
        if incorrect:
212
212
            help_text = ["Some files have missing or incorrect copyright"
219
219
                         "or add '# Copyright (C)"
220
220
                         " 2007 Bazaar hackers' to these files:",
221
221
                         "",
222
 
                        ]
 
222
                         ]
223
223
            for fname, comment in incorrect:
224
224
                help_text.append(fname)
225
225
                help_text.append((' ' * 4) + comment)
275
275
 
276
276
    def _format_message(self, dict_, message):
277
277
        files = sorted(["%s: %s" % (f, ', '.join([str(i + 1) for i in lines]))
278
 
                for f, lines in dict_.items()])
 
278
                        for f, lines in dict_.items()])
279
279
        return message + '\n\n    %s' % ('\n    '.join(files))
280
280
 
281
281
    def test_coding_style(self):
309
309
        problems = []
310
310
        if tabs:
311
311
            problems.append(self._format_message(tabs,
312
 
                'Tab characters were found in the following source files.'
313
 
                '\nThey should either be replaced by "\\t" or by spaces:'))
 
312
                                                 'Tab characters were found in the following source files.'
 
313
                                                 '\nThey should either be replaced by "\\t" or by spaces:'))
314
314
        if illegal_newlines:
315
315
            problems.append(self._format_message(illegal_newlines,
316
 
                'Non-unix newlines were found in the following source files:'))
 
316
                                                 'Non-unix newlines were found in the following source files:'))
317
317
        if no_newline_at_eof:
318
318
            no_newline_at_eof.sort()
319
319
            problems.append("The following source files doesn't have a "
320
 
                "newline at the end:"
321
 
               '\n\n    %s'
322
 
               % ('\n    '.join(no_newline_at_eof)))
 
320
                            "newline at the end:"
 
321
                            '\n\n    %s'
 
322
                            % ('\n    '.join(no_newline_at_eof)))
323
323
        if problems:
324
324
            self.fail('\n\n'.join(problems))
325
325