/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-08-10 15:00:17 UTC
  • mfrom: (7490.40.99 work)
  • mto: This revision was merged to the branch mainline in revision 7521.
  • Revision ID: jelmer@jelmer.uk-20200810150017-vs7xnrd1vat4iktg
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from testtools.matchers import *
20
20
 
21
 
from ..sixish import PY3
22
 
 
23
21
from . import (
24
22
    CapturedCall,
25
23
    TestCase,
132
130
        t.add(['a', 'b', 'b/c'], [b'a-id', b'b-id', b'c-id'])
133
131
        mismatch = HasLayout(['a']).match(t)
134
132
        self.assertIsNot(None, mismatch)
135
 
        if PY3:
136
 
            self.assertEqual(
137
 
                set(("['', 'a', 'b/', 'b/c']", "['a']")),
138
 
                set(mismatch.describe().split(" != ")))
139
 
        else:
140
 
            self.assertEqual(
141
 
                set(("[u'', u'a', u'b/', u'b/c']", "['a']")),
142
 
                set(mismatch.describe().split(" != ")))
 
133
        self.assertEqual(
 
134
            set(("['', 'a', 'b/', 'b/c']", "['a']")),
 
135
            set(mismatch.describe().split(" != ")))
143
136
 
144
137
    def test_no_dirs(self):
145
138
        # Some tree/repository formats do not support versioned directories
151
144
        self.assertIs(None, HasLayout(['', 'a', 'b/', 'b/c', 'd/']).match(t))
152
145
        mismatch = HasLayout([u'', u'a', u'd/']).match(t)
153
146
        self.assertIsNot(None, mismatch)
154
 
        if PY3:
155
 
            self.assertEqual(
156
 
                set(("['', 'a', 'b/', 'b/c']", "['', 'a']")),
157
 
                set(mismatch.describe().split(" != ")))
158
 
        else:
159
 
            self.assertEqual(
160
 
                set(("[u'', u'a', u'b/', u'b/c']", "[u'', u'a']")),
161
 
                set(mismatch.describe().split(" != ")))
 
147
        self.assertEqual(
 
148
            set(("['', 'a', 'b/', 'b/c']", "['', 'a']")),
 
149
            set(mismatch.describe().split(" != ")))
162
150
 
163
151
 
164
152
class TestHasPathRelations(TestCaseWithTransport):
206
194
        tree.commit('msg1', rev_id=b'a')
207
195
        tree.commit('msg2', rev_id=b'b')
208
196
        matcher = RevisionHistoryMatches([b'a', b'b', b'c'])
209
 
        if PY3:
210
 
            self.assertEqual(
211
 
                set(("[b'a', b'b']", "[b'a', b'b', b'c']")),
212
 
                set(matcher.match(tree.branch).describe().split(" != ")))
213
 
        else:
214
 
            self.assertEqual(
215
 
                set(("['a', 'b']", "['a', 'b', 'c']")),
216
 
                set(matcher.match(tree.branch).describe().split(" != ")))
 
197
        self.assertEqual(
 
198
            set(("[b'a', b'b']", "[b'a', b'b', b'c']")),
 
199
            set(matcher.match(tree.branch).describe().split(" != ")))