/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

Support user.signingkey configuration variable in .git/config.

Merged from https://code.launchpad.net/~jelmer/brz/local-git-key/+merge/381000

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
22
23
 
23
24
from . import (
24
25
    CapturedCall,
132
133
        t.add(['a', 'b', 'b/c'], [b'a-id', b'b-id', b'c-id'])
133
134
        mismatch = HasLayout(['a']).match(t)
134
135
        self.assertIsNot(None, mismatch)
135
 
        self.assertEqual(
136
 
            set(("['', 'a', 'b/', 'b/c']", "['a']")),
137
 
            set(mismatch.describe().split(" != ")))
 
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(" != ")))
138
144
 
139
145
    def test_no_dirs(self):
140
146
        # Some tree/repository formats do not support versioned directories
146
152
        self.assertIs(None, HasLayout(['', 'a', 'b/', 'b/c', 'd/']).match(t))
147
153
        mismatch = HasLayout([u'', u'a', u'd/']).match(t)
148
154
        self.assertIsNot(None, mismatch)
149
 
        self.assertEqual(
150
 
            set(("['', 'a', 'b/', 'b/c']", "['', 'a']")),
151
 
            set(mismatch.describe().split(" != ")))
 
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(" != ")))
152
163
 
153
164
 
154
165
class TestHasPathRelations(TestCaseWithTransport):
226
237
        tree.commit('msg1', rev_id=b'a')
227
238
        tree.commit('msg2', rev_id=b'b')
228
239
        matcher = RevisionHistoryMatches([b'a', b'b', b'c'])
229
 
        self.assertEqual(
230
 
            set(("[b'a', b'b']", "[b'a', b'b', b'c']")),
231
 
            set(matcher.match(tree.branch).describe().split(" != ")))
 
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(" != ")))