/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_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:
60
60
    def test_match(self):
61
61
        stub_tree = StubTree(False)
62
62
        matcher = ReturnsUnlockable(stub_tree)
63
 
        self.assertThat(matcher.match(lambda:FakeUnlockable()), Equals(None))
 
63
        self.assertThat(matcher.match(lambda: FakeUnlockable()), Equals(None))
64
64
 
65
65
    def test_mismatch(self):
66
66
        stub_tree = StubTree(True)
67
67
        matcher = ReturnsUnlockable(stub_tree)
68
 
        mismatch = matcher.match(lambda:FakeUnlockable())
 
68
        mismatch = matcher.match(lambda: FakeUnlockable())
69
69
        self.assertNotEqual(None, mismatch)
70
70
        self.assertThat(mismatch.describe(), Equals("I am da tree is locked"))
71
71
 
167
167
    def test__str__(self):
168
168
        t = self.make_branch_and_tree('.')
169
169
        matcher = HasPathRelations(t, [("a", "b")])
170
 
        self.assertEqual("HasPathRelations(%r, %r)" % (t, [('a', 'b')]), str(matcher))
 
170
        self.assertEqual("HasPathRelations(%r, %r)" %
 
171
                         (t, [('a', 'b')]), str(matcher))
171
172
 
172
173
    def test_match(self):
173
174
        t = self.make_branch_and_tree('.')
174
175
        self.build_tree(['a', 'b/', 'b/c'])
175
176
        t.add(['a', 'b', 'b/c'])
176
177
        self.assertThat(t, HasPathRelations(t,
177
 
            [('', ''),
178
 
             ('a', 'a'),
179
 
             ('b/', 'b/'),
180
 
             ('b/c', 'b/c')]))
 
178
                                            [('', ''),
 
179
                                             ('a', 'a'),
 
180
                                                ('b/', 'b/'),
 
181
                                                ('b/c', 'b/c')]))
181
182
 
182
183
    def test_mismatch(self):
183
184
        t = self.make_branch_and_tree('.')
213
214
        self.assertIsNot(None, mismatch)
214
215
        self.assertEqual([calls[0].call], mismatch.vfs_calls)
215
216
        self.assertIn(mismatch.describe(), [
216
 
                "no VFS calls expected, got: b'append'(b'file')",
217
 
                "no VFS calls expected, got: append('file')"])
 
217
            "no VFS calls expected, got: b'append'(b'file')",
 
218
            "no VFS calls expected, got: append('file')"])
218
219
 
219
220
 
220
221
class TestRevisionHistoryMatches(TestCaseWithTransport):