source: python/trunk/Lib/test/test_future4.py

Last change on this file was 391, checked in by dmik, 11 years ago

python: Merge vendor 2.7.6 to trunk.

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1from __future__ import unicode_literals
2
3import unittest
4from test import test_support
5
6class TestFuture(unittest.TestCase):
7 def assertType(self, obj, typ):
8 self.assertTrue(type(obj) is typ,
9 "type(%r) is %r, not %r" % (obj, type(obj), typ))
10
11 def test_unicode_strings(self):
12 self.assertType("", unicode)
13 self.assertType('', unicode)
14 self.assertType(r"", unicode)
15 self.assertType(r'', unicode)
16 self.assertType(""" """, unicode)
17 self.assertType(''' ''', unicode)
18 self.assertType(r""" """, unicode)
19 self.assertType(r''' ''', unicode)
20 self.assertType(u"", unicode)
21 self.assertType(u'', unicode)
22 self.assertType(ur"", unicode)
23 self.assertType(ur'', unicode)
24 self.assertType(u""" """, unicode)
25 self.assertType(u''' ''', unicode)
26 self.assertType(ur""" """, unicode)
27 self.assertType(ur''' ''', unicode)
28
29 self.assertType(b"", str)
30 self.assertType(b'', str)
31 self.assertType(br"", str)
32 self.assertType(br'', str)
33 self.assertType(b""" """, str)
34 self.assertType(b''' ''', str)
35 self.assertType(br""" """, str)
36 self.assertType(br''' ''', str)
37
38 self.assertType('' '', unicode)
39 self.assertType('' u'', unicode)
40 self.assertType(u'' '', unicode)
41 self.assertType(u'' u'', unicode)
42
43def test_main():
44 test_support.run_unittest(TestFuture)
45
46if __name__ == "__main__":
47 test_main()
Note: See TracBrowser for help on using the repository browser.