You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by cu...@apache.org on 2014/07/16 22:06:20 UTC

svn commit: r1611164 - /avro/trunk/lang/py3/avro/tests/test_script.py

Author: cutting
Date: Wed Jul 16 20:06:20 2014
New Revision: 1611164

URL: http://svn.apache.org/r1611164
Log:
AVRO-1448. Fix failing test.

Modified:
    avro/trunk/lang/py3/avro/tests/test_script.py

Modified: avro/trunk/lang/py3/avro/tests/test_script.py
URL: http://svn.apache.org/viewvc/avro/trunk/lang/py3/avro/tests/test_script.py?rev=1611164&r1=1611163&r2=1611164&view=diff
==============================================================================
--- avro/trunk/lang/py3/avro/tests/test_script.py (original)
+++ avro/trunk/lang/py3/avro/tests/test_script.py Wed Jul 16 20:06:20 2014
@@ -105,14 +105,11 @@ def RunScript(*args, stdin=None):
   return out
 
 
-# The trailing spaces are expected when pretty-printing JSON with json.dumps():
-_JSON_PRETTY = '\n'.join([
-    '{',
-    '    "first": "daffy",',
-    '    "last": "duck",',
-    '    "type": "duck"',
-    '}',
-])
+_TEST_JSON_VALUE = {
+  'first': 'daffy',
+  'last': 'duck',
+  'type': 'duck',
+}
 
 
 # ------------------------------------------------------------------------------
@@ -193,12 +190,12 @@ class TestCat(unittest.TestCase):
   def testJsonPretty(self):
     out = self._RunCat('--format', 'json-pretty', '-n', '1')
     self.assertEqual(
-        out.strip(),
-        _JSON_PRETTY.strip(),
+        json.loads(out),
+        _TEST_JSON_VALUE,
         'Output mismatch\n'
         'Expect: %r\n'
         'Actual: %r'
-        % (_JSON_PRETTY.strip(), out.strip()))
+        % (_TEST_JSON_VALUE, out))
 
   def testVersion(self):
     out = RunScript('cat', '--version').decode('utf-8')