/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: Jelmer Vernooij
  • Date: 2020-06-10 03:30:11 UTC
  • mto: (7490.40.9 work)
  • mto: This revision was merged to the branch mainline in revision 7511.
  • Revision ID: jelmer@jelmer.uk-20200610033011-90pn0ggty8f7r3yu
Fix tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from testtools.matchers import *
20
20
 
21
 
from ..bzr.smart.client import CallHookParams
22
21
from ..sixish import PY3
23
22
 
24
23
from . import (
188
187
        self.assertIsNot(None, mismatch)
189
188
 
190
189
 
191
 
class TestContainsNoVfsCalls(TestCase):
192
 
 
193
 
    def _make_call(self, method, args):
194
 
        return CapturedCall(CallHookParams(method, args, None, None, None), 0)
195
 
 
196
 
    def test__str__(self):
197
 
        self.assertEqual("ContainsNoVfsCalls()", str(ContainsNoVfsCalls()))
198
 
 
199
 
    def test_empty(self):
200
 
        self.assertIs(None, ContainsNoVfsCalls().match([]))
201
 
 
202
 
    def test_no_vfs_calls(self):
203
 
        calls = [self._make_call("Branch.get_config_file", [])]
204
 
        self.assertIs(None, ContainsNoVfsCalls().match(calls))
205
 
 
206
 
    def test_ignores_unknown(self):
207
 
        calls = [self._make_call("unknown", [])]
208
 
        self.assertIs(None, ContainsNoVfsCalls().match(calls))
209
 
 
210
 
    def test_match(self):
211
 
        calls = [self._make_call(b"append", [b"file"]),
212
 
                 self._make_call(b"Branch.get_config_file", [])]
213
 
        mismatch = ContainsNoVfsCalls().match(calls)
214
 
        self.assertIsNot(None, mismatch)
215
 
        self.assertEqual([calls[0].call], mismatch.vfs_calls)
216
 
        self.assertIn(mismatch.describe(), [
217
 
            "no VFS calls expected, got: b'append'(b'file')",
218
 
            "no VFS calls expected, got: append('file')"])
219
 
 
220
 
 
221
190
class TestRevisionHistoryMatches(TestCaseWithTransport):
222
191
 
223
192
    def test_empty(self):