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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-11-16 18:59:44 UTC
  • mfrom: (7143.15.15 more-cleanups)
  • Revision ID: breezy.the.bot@gmail.com-20181116185944-biefv1sub37qfybm
Sprinkle some PEP8iness.

Merged from https://code.launchpad.net/~jelmer/brz/more-cleanups/+merge/358611

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    )
42
42
from .. import lazy_import
43
43
lazy_import.lazy_import(globals(),
44
 
"""
 
44
                        """
45
45
from breezy.bzr.smart.request import request_handlers as smart_request_handlers
46
46
from breezy.bzr.smart import vfs
47
47
""")
69
69
 
70
70
    def __str__(self):
71
71
        return ('ReturnsUnlockable(lockable_thing=%s)' %
72
 
            self.lockable_thing)
 
72
                self.lockable_thing)
73
73
 
74
74
    def match(self, lock_method):
75
75
        lock_method().unlock()
125
125
                got.remove(_mod_revision.NULL_REVISION)
126
126
        if sorted(got) != sorted(expected):
127
127
            return _AncestryMismatch(self.revision_id, sorted(got),
128
 
                sorted(expected))
 
128
                                     sorted(expected))
129
129
 
130
130
 
131
131
class HasLayout(Matcher):
176
176
        return 'HasLayout(%r)' % self.entries
177
177
 
178
178
    def match(self, tree):
179
 
        include_file_ids = self.entries and not isinstance(self.entries[0], (str, text_type))
180
 
        actual = list(self.get_tree_layout(tree, include_file_ids=include_file_ids))
 
179
        include_file_ids = self.entries and not isinstance(
 
180
            self.entries[0], (str, text_type))
 
181
        actual = list(self.get_tree_layout(
 
182
            tree, include_file_ids=include_file_ids))
181
183
        if not tree.has_versioned_directories():
182
184
            entries = list(self._strip_unreferenced_directories(self.entries))
183
185
        else:
202
204
        with tree.lock_read(), self.previous_tree.lock_read():
203
205
            for path, ie in tree.iter_entries_by_dir():
204
206
                if tree.supports_rename_tracking():
205
 
                    previous_path = find_previous_path(tree, self.previous_tree, path)
 
207
                    previous_path = find_previous_path(
 
208
                        tree, self.previous_tree, path)
206
209
                else:
207
210
                    if self.previous_tree.is_versioned(path):
208
211
                        previous_path = path
215
218
                if path == u'':
216
219
                    yield (u"", previous_path)
217
220
                else:
218
 
                    yield (path+ie.kind_character(), previous_path)
 
221
                    yield (path + ie.kind_character(), previous_path)
219
222
 
220
223
    @staticmethod
221
224
    def _strip_unreferenced_directories(entries):
244
247
    def match(self, tree):
245
248
        actual = list(self.get_path_map(tree))
246
249
        if not tree.has_versioned_directories():
247
 
            entries = list(self._strip_unreferenced_directories(self.previous_entries))
 
250
            entries = list(self._strip_unreferenced_directories(
 
251
                self.previous_entries))
248
252
        else:
249
253
            entries = self.previous_entries
250
254
        if not tree.supports_rename_tracking():
285
289
    def describe(self):
286
290
        return "no VFS calls expected, got: %s" % ",".join([
287
291
            "%s(%s)" % (c.method,
288
 
                ", ".join([repr(a) for a in c.args])) for c in self.vfs_calls])
 
292
                        ", ".join([repr(a) for a in c.args])) for c in self.vfs_calls])
289
293
 
290
294
 
291
295
class ContainsNoVfsCalls(Matcher):