/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__static_tuple.py

  • Committer: Jelmer Vernooij
  • Date: 2020-07-05 12:50:01 UTC
  • mfrom: (7490.40.46 work)
  • mto: (7490.40.48 work)
  • mto: This revision was merged to the branch mainline in revision 7519.
  • Revision ID: jelmer@jelmer.uk-20200705125001-7s3vo0p55szbbws7
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    static_tuple,
31
31
    tests,
32
32
    )
 
33
from breezy.sixish import (
 
34
    PY3,
 
35
    text_type,
 
36
    )
33
37
from breezy.tests import (
34
38
    features,
35
39
    )
217
221
        # But not a subclass, because subint could introduce refcycles
218
222
        self.assertRaises(TypeError, self.module.StaticTuple, subint(2))
219
223
 
 
224
    def test_holds_long(self):
 
225
        if PY3:
 
226
            self.skipTest("No long type on Python 3")
 
227
        k1 = self.module.StaticTuple(2**65)
 
228
 
 
229
        class sublong(long):
 
230
            pass
 
231
        # But not a subclass
 
232
        self.assertRaises(TypeError, self.module.StaticTuple, sublong(1))
 
233
 
220
234
    def test_holds_float(self):
221
235
        k1 = self.module.StaticTuple(1.2)
222
236
 
234
248
    def test_holds_unicode(self):
235
249
        k1 = self.module.StaticTuple(u'\xb5')
236
250
 
237
 
        class subunicode(str):
 
251
        class subunicode(text_type):
238
252
            pass
239
253
        self.assertRaises(TypeError, self.module.StaticTuple,
240
254
                          subunicode(u'\xb5'))
281
295
 
282
296
    def check_strict_compare(self, k1, k2, mismatched_types):
283
297
        """True if on Python 3 and stricter comparison semantics are used."""
284
 
        if mismatched_types:
 
298
        if PY3 and mismatched_types:
285
299
            for op in ("ge", "gt", "le", "lt"):
286
300
                self.assertRaises(TypeError, getattr(operator, op), k1, k2)
287
301
            return True