summaryrefslogtreecommitdiff
path: root/lib/py/test/thrift_json.py
diff options
context:
space:
mode:
authorNobuaki Sukegawa <nsuke@apache.org>2016-02-03 01:57:03 +0900
committerNobuaki Sukegawa <nsuke@apache.org>2016-02-04 14:28:24 +0900
commit10308cb975ac090584068d0470b81e41555b2f35 (patch)
treebc0bb670626a8a196dc00df6429ae4dcc838b4c4 /lib/py/test/thrift_json.py
parentd094e79de7e0bd61320f006c83c0de669363bce8 (diff)
downloadthrift-10308cb975ac090584068d0470b81e41555b2f35.tar.gz
THRIFT-3596 Better conformance to PEP8
This closes #832
Diffstat (limited to 'lib/py/test/thrift_json.py')
-rw-r--r--lib/py/test/thrift_json.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/py/test/thrift_json.py b/lib/py/test/thrift_json.py
index e60aabacf..5ba7dd585 100644
--- a/lib/py/test/thrift_json.py
+++ b/lib/py/test/thrift_json.py
@@ -31,20 +31,20 @@ from thrift.transport import TTransport
# mklink /D thrift ..\src
#
+
class TestJSONString(unittest.TestCase):
- def test_escaped_unicode_string(self):
- unicode_json = b'"hello \\u0e01\\u0e02\\u0e03\\ud835\\udcab\\udb40\\udc70 unicode"'
- unicode_text = u'hello \u0e01\u0e02\u0e03\U0001D4AB\U000E0070 unicode'
+ def test_escaped_unicode_string(self):
+ unicode_json = b'"hello \\u0e01\\u0e02\\u0e03\\ud835\\udcab\\udb40\\udc70 unicode"'
+ unicode_text = u'hello \u0e01\u0e02\u0e03\U0001D4AB\U000E0070 unicode'
- buf = TTransport.TMemoryBuffer(unicode_json)
- transport = TTransport.TBufferedTransportFactory().getTransport(buf)
- protocol = TJSONProtocol(transport)
+ buf = TTransport.TMemoryBuffer(unicode_json)
+ transport = TTransport.TBufferedTransportFactory().getTransport(buf)
+ protocol = TJSONProtocol(transport)
- if sys.version_info[0] == 2:
- unicode_text = unicode_text.encode('utf8')
- self.assertEqual(protocol.readString(), unicode_text)
+ if sys.version_info[0] == 2:
+ unicode_text = unicode_text.encode('utf8')
+ self.assertEqual(protocol.readString(), unicode_text)
if __name__ == '__main__':
- unittest.main()
-
+ unittest.main()