'Verify correct validation and JSON syntax conversion of CSV strings'

def testValidationCSVSyntaxNative(self):

    assertEqual = self.assertEqual
    assertNotEqual = self.assertNotEqual
    current.response.s3.bulk = True
    try:
        validator = IS_JSONS3(native_json=True)
        jsonstr = "{'a':    1}"
        (value, error) = validator(jsonstr)
        assertEqual(error, None)
        assertEqual(value, '{"a":1}')
        jsonstr = '{\'a\':    \'this    ain\\\'t    a    good    "example"\'}'
        (value, error) = validator(jsonstr)
        assertEqual(error, None)
        assertEqual(value, '{"a":"this    ain\'t    a    good    \\"example\\""}')
        jsonstr = '{"a":    1}'
        (value, error) = validator(jsonstr)
        assertEqual(error, None)
        assertEqual(value, '{"a":1}')
        jsonstr = 'not    JSON    at    all'
        (value, error) = validator(jsonstr)
        assertNotEqual(error, None)
        assertEqual(value, jsonstr)
    finally:
        current.response.s3.bulk = False
