/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: 2020-02-14 03:16:54 UTC
  • mfrom: (7479.2.3 no-more-python2)
  • Revision ID: breezy.the.bot@gmail.com-20200214031654-bp1xtv2jr9nmhto3
Drop python2 support.

Merged from https://code.launchpad.net/~jelmer/brz/no-more-python2/+merge/378694

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from testtools.matchers import *
20
20
 
21
21
from ..bzr.smart.client import CallHookParams
22
 
from ..sixish import PY3
23
22
 
24
23
from . import (
25
24
    CapturedCall,
133
132
        t.add(['a', 'b', 'b/c'], [b'a-id', b'b-id', b'c-id'])
134
133
        mismatch = HasLayout(['a']).match(t)
135
134
        self.assertIsNot(None, mismatch)
136
 
        if PY3:
137
 
            self.assertEqual(
138
 
                set(("['', 'a', 'b/', 'b/c']", "['a']")),
139
 
                set(mismatch.describe().split(" != ")))
140
 
        else:
141
 
            self.assertEqual(
142
 
                set(("[u'', u'a', u'b/', u'b/c']", "['a']")),
143
 
                set(mismatch.describe().split(" != ")))
 
135
        self.assertEqual(
 
136
            set(("['', 'a', 'b/', 'b/c']", "['a']")),
 
137
            set(mismatch.describe().split(" != ")))
144
138
 
145
139
    def test_no_dirs(self):
146
140
        # Some tree/repository formats do not support versioned directories
152
146
        self.assertIs(None, HasLayout(['', 'a', 'b/', 'b/c', 'd/']).match(t))
153
147
        mismatch = HasLayout([u'', u'a', u'd/']).match(t)
154
148
        self.assertIsNot(None, mismatch)
155
 
        if PY3:
156
 
            self.assertEqual(
157
 
                set(("['', 'a', 'b/', 'b/c']", "['', 'a']")),
158
 
                set(mismatch.describe().split(" != ")))
159
 
        else:
160
 
            self.assertEqual(
161
 
                set(("[u'', u'a', u'b/', u'b/c']", "[u'', u'a']")),
162
 
                set(mismatch.describe().split(" != ")))
 
149
        self.assertEqual(
 
150
            set(("['', 'a', 'b/', 'b/c']", "['', 'a']")),
 
151
            set(mismatch.describe().split(" != ")))
163
152
 
164
153
 
165
154
class TestHasPathRelations(TestCaseWithTransport):
237
226
        tree.commit('msg1', rev_id=b'a')
238
227
        tree.commit('msg2', rev_id=b'b')
239
228
        matcher = RevisionHistoryMatches([b'a', b'b', b'c'])
240
 
        if PY3:
241
 
            self.assertEqual(
242
 
                set(("[b'a', b'b']", "[b'a', b'b', b'c']")),
243
 
                set(matcher.match(tree.branch).describe().split(" != ")))
244
 
        else:
245
 
            self.assertEqual(
246
 
                set(("['a', 'b']", "['a', 'b', 'c']")),
247
 
                set(matcher.match(tree.branch).describe().split(" != ")))
 
229
        self.assertEqual(
 
230
            set(("[b'a', b'b']", "[b'a', b'b', b'c']")),
 
231
            set(matcher.match(tree.branch).describe().split(" != ")))