def test_invalid_str_to_buitin_fromjson(self):
        types = six.integer_types + (float, bool)
        value = '2a'
        for t in types:
            for ba in True, False:
                jd = '"%s"' if ba else '{"a": "%s"}'
                try:
                    parse(jd % value, {'a': t}, ba)
                    assert False, (
                        "Value '%s' should not parse correctly for %s." %
                        (value, t)
                    )
                except ClientSideError as e:
                    self.assertIsInstance(e, InvalidInput)
                    self.assertEqual(e.fieldname, 'a')
                    self.assertEqual(e.value, value)
dataset/ETHPy150Open openstack/wsme/wsme/tests/test_restjson.py/TestRestJson.test_invalid_str_to_buitin_fromjson/original