Python simplejson.decoder() Examples

The following are code examples for showing how to use simplejson.decoder(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: FUTU_Stop_Loss   Author: BigtoC   File: __init__.py    MIT License 6 votes vote down vote up
def additional_tests(suite=None):
    import simplejson
    import simplejson.encoder
    import simplejson.decoder
    if suite is None:
        suite = unittest.TestSuite()
    try:
        import doctest
    except ImportError:
        if sys.version_info < (2, 7):
            # doctests in 2.6 depends on cStringIO
            return suite
        raise
    for mod in (simplejson, simplejson.encoder, simplejson.decoder):
        suite.addTest(doctest.DocTestSuite(mod))
    suite.addTest(doctest.DocFileSuite('../../index.rst'))
    return suite 
Example 2
Project: fund   Author: Frank-qlu   File: __init__.py    Apache License 2.0 6 votes vote down vote up
def additional_tests(suite=None):
    import simplejson
    import simplejson.encoder
    import simplejson.decoder
    if suite is None:
        suite = unittest.TestSuite()
    try:
        import doctest
    except ImportError:
        if sys.version_info < (2, 7):
            # doctests in 2.6 depends on cStringIO
            return suite
        raise
    for mod in (simplejson, simplejson.encoder, simplejson.decoder):
        suite.addTest(doctest.DocTestSuite(mod))
    suite.addTest(doctest.DocFileSuite('../../index.rst'))
    return suite 
Example 3
Project: FUTU_Stop_Loss   Author: BigtoC   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_py_scanstring(self):
        self._test_scanstring(simplejson.decoder.py_scanstring) 
Example 4
Project: FUTU_Stop_Loss   Author: BigtoC   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_c_scanstring(self):
        if not simplejson.decoder.c_scanstring:
            return
        self._test_scanstring(simplejson.decoder.c_scanstring)

        self.assertTrue(isinstance(simplejson.decoder.c_scanstring('""', 0)[0], str)) 
Example 5
Project: FUTU_Stop_Loss   Author: BigtoC   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_issue3623(self):
        self.assertRaises(ValueError, json.decoder.scanstring, "xxx", 1,
                          "xxx")
        self.assertRaises(UnicodeDecodeError,
                          json.encoder.encode_basestring_ascii, b("xx\xff")) 
Example 6
Project: FUTU_Stop_Loss   Author: BigtoC   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_overflow(self):
        # Python 2.5 does not have maxsize, Python 3 does not have maxint
        maxsize = getattr(sys, 'maxsize', getattr(sys, 'maxint', None))
        assert maxsize is not None
        self.assertRaises(OverflowError, json.decoder.scanstring, "xxx",
                          maxsize + 1) 
Example 7
Project: tra-tracking-on-gae   Author: elliot79313   File: __init__.py    MIT License 5 votes vote down vote up
def additional_tests(suite=None):
    import simplejson
    import simplejson.encoder
    import simplejson.decoder
    if suite is None:
        suite = unittest.TestSuite()
    for mod in (simplejson, simplejson.encoder, simplejson.decoder):
        suite.addTest(doctest.DocTestSuite(mod))
    suite.addTest(doctest.DocFileSuite('../../index.rst'))
    return suite 
Example 8
Project: tra-tracking-on-gae   Author: elliot79313   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_py_scanstring(self):
        self._test_scanstring(simplejson.decoder.py_scanstring) 
Example 9
Project: tra-tracking-on-gae   Author: elliot79313   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_c_scanstring(self):
        if not simplejson.decoder.c_scanstring:
            return
        self._test_scanstring(simplejson.decoder.c_scanstring) 
Example 10
Project: tra-tracking-on-gae   Author: elliot79313   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_issue3623(self):
        self.assertRaises(ValueError, json.decoder.scanstring, "xxx", 1,
                          "xxx")
        self.assertRaises(UnicodeDecodeError,
                          json.encoder.encode_basestring_ascii, b("xx\xff")) 
Example 11
Project: tra-tracking-on-gae   Author: elliot79313   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_overflow(self):
        # Python 2.5 does not have maxsize, Python 3 does not have maxint
        maxsize = getattr(sys, 'maxsize', getattr(sys, 'maxint', None))
        assert maxsize is not None
        self.assertRaises(OverflowError, json.decoder.scanstring, "xxx",
                          maxsize + 1) 
Example 12
Project: ableton-live-webapi   Author: valsteen   File: __init__.py    The Unlicense 5 votes vote down vote up
def additional_tests(suite=None):
    import simplejson
    import simplejson.encoder
    import simplejson.decoder
    if suite is None:
        suite = unittest.TestSuite()
    for mod in (simplejson, simplejson.encoder, simplejson.decoder):
        suite.addTest(doctest.DocTestSuite(mod))
    suite.addTest(doctest.DocFileSuite('../../index.rst'))
    return suite 
Example 13
Project: ableton-live-webapi   Author: valsteen   File: test_scanstring.py    The Unlicense 5 votes vote down vote up
def test_py_scanstring(self):
        self._test_scanstring(simplejson.decoder.py_scanstring) 
Example 14
Project: ableton-live-webapi   Author: valsteen   File: test_scanstring.py    The Unlicense 5 votes vote down vote up
def test_c_scanstring(self):
        if not simplejson.decoder.c_scanstring:
            return
        self._test_scanstring(simplejson.decoder.c_scanstring) 
Example 15
Project: ableton-live-webapi   Author: valsteen   File: test_scanstring.py    The Unlicense 5 votes vote down vote up
def test_issue3623(self):
        self.assertRaises(ValueError, json.decoder.scanstring, "xxx", 1,
                          "xxx")
        self.assertRaises(UnicodeDecodeError,
                          json.encoder.encode_basestring_ascii, b("xx\xff")) 
Example 16
Project: ableton-live-webapi   Author: valsteen   File: test_scanstring.py    The Unlicense 5 votes vote down vote up
def test_overflow(self):
        # Python 2.5 does not have maxsize, Python 3 does not have maxint
        maxsize = getattr(sys, 'maxsize', getattr(sys, 'maxint', None))
        assert maxsize is not None
        self.assertRaises(OverflowError, json.decoder.scanstring, "xxx",
                          maxsize + 1) 
Example 17
Project: fund   Author: Frank-qlu   File: test_scanstring.py    Apache License 2.0 5 votes vote down vote up
def test_py_scanstring(self):
        self._test_scanstring(simplejson.decoder.py_scanstring) 
Example 18
Project: fund   Author: Frank-qlu   File: test_scanstring.py    Apache License 2.0 5 votes vote down vote up
def test_c_scanstring(self):
        if not simplejson.decoder.c_scanstring:
            return
        self._test_scanstring(simplejson.decoder.c_scanstring)

        self.assertTrue(isinstance(simplejson.decoder.c_scanstring('""', 0)[0], str)) 
Example 19
Project: fund   Author: Frank-qlu   File: test_scanstring.py    Apache License 2.0 5 votes vote down vote up
def test_issue3623(self):
        self.assertRaises(ValueError, json.decoder.scanstring, "xxx", 1,
                          "xxx")
        self.assertRaises(UnicodeDecodeError,
                          json.encoder.encode_basestring_ascii, b("xx\xff")) 
Example 20
Project: fund   Author: Frank-qlu   File: test_scanstring.py    Apache License 2.0 5 votes vote down vote up
def test_overflow(self):
        # Python 2.5 does not have maxsize, Python 3 does not have maxint
        maxsize = getattr(sys, 'maxsize', getattr(sys, 'maxint', None))
        assert maxsize is not None
        self.assertRaises(OverflowError, json.decoder.scanstring, "xxx",
                          maxsize + 1) 
Example 21
Project: oscars2016   Author: 0x0ece   File: __init__.py    Apache License 2.0 5 votes vote down vote up
def additional_tests(suite=None):
    import simplejson
    import simplejson.encoder
    import simplejson.decoder
    if suite is None:
        suite = unittest.TestSuite()
    for mod in (simplejson, simplejson.encoder, simplejson.decoder):
        suite.addTest(doctest.DocTestSuite(mod))
    suite.addTest(doctest.DocFileSuite('../../index.rst'))
    return suite 
Example 22
Project: oscars2016   Author: 0x0ece   File: test_scanstring.py    Apache License 2.0 5 votes vote down vote up
def test_py_scanstring(self):
        self._test_scanstring(simplejson.decoder.py_scanstring) 
Example 23
Project: oscars2016   Author: 0x0ece   File: test_scanstring.py    Apache License 2.0 5 votes vote down vote up
def test_c_scanstring(self):
        if not simplejson.decoder.c_scanstring:
            return
        self._test_scanstring(simplejson.decoder.c_scanstring) 
Example 24
Project: oscars2016   Author: 0x0ece   File: test_scanstring.py    Apache License 2.0 5 votes vote down vote up
def test_issue3623(self):
        self.assertRaises(ValueError, json.decoder.scanstring, "xxx", 1,
                          "xxx")
        self.assertRaises(UnicodeDecodeError,
                          json.encoder.encode_basestring_ascii, b("xx\xff")) 
Example 25
Project: oscars2016   Author: 0x0ece   File: test_scanstring.py    Apache License 2.0 5 votes vote down vote up
def test_overflow(self):
        # Python 2.5 does not have maxsize, Python 3 does not have maxint
        maxsize = getattr(sys, 'maxsize', getattr(sys, 'maxint', None))
        assert maxsize is not None
        self.assertRaises(OverflowError, json.decoder.scanstring, "xxx",
                          maxsize + 1) 
Example 26
Project: that-startpage-rocks   Author: the-duck   File: __init__.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def additional_tests(suite=None):
    import simplejson
    import simplejson.encoder
    import simplejson.decoder
    if suite is None:
        suite = unittest.TestSuite()
    for mod in (simplejson, simplejson.encoder, simplejson.decoder):
        suite.addTest(doctest.DocTestSuite(mod))
    suite.addTest(doctest.DocFileSuite('../../index.rst'))
    return suite 
Example 27
Project: that-startpage-rocks   Author: the-duck   File: test_scanstring.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def test_py_scanstring(self):
        self._test_scanstring(simplejson.decoder.py_scanstring) 
Example 28
Project: that-startpage-rocks   Author: the-duck   File: test_scanstring.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def test_c_scanstring(self):
        if not simplejson.decoder.c_scanstring:
            return
        self._test_scanstring(simplejson.decoder.c_scanstring) 
Example 29
Project: that-startpage-rocks   Author: the-duck   File: test_scanstring.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def test_issue3623(self):
        self.assertRaises(ValueError, json.decoder.scanstring, "xxx", 1,
                          "xxx")
        self.assertRaises(UnicodeDecodeError,
                          json.encoder.encode_basestring_ascii, b("xx\xff")) 
Example 30
Project: that-startpage-rocks   Author: the-duck   File: test_scanstring.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def test_overflow(self):
        # Python 2.5 does not have maxsize, Python 3 does not have maxint
        maxsize = getattr(sys, 'maxsize', getattr(sys, 'maxint', None))
        assert maxsize is not None
        self.assertRaises(OverflowError, json.decoder.scanstring, "xxx",
                          maxsize + 1) 
Example 31
Project: cohesive-networks-vns3-vpn-monitoring   Author: trek10inc   File: __init__.py    MIT License 5 votes vote down vote up
def additional_tests(suite=None):
    import simplejson
    import simplejson.encoder
    import simplejson.decoder
    if suite is None:
        suite = unittest.TestSuite()
    for mod in (simplejson, simplejson.encoder, simplejson.decoder):
        suite.addTest(doctest.DocTestSuite(mod))
    suite.addTest(doctest.DocFileSuite('../../index.rst'))
    return suite 
Example 32
Project: cohesive-networks-vns3-vpn-monitoring   Author: trek10inc   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_py_scanstring(self):
        self._test_scanstring(simplejson.decoder.py_scanstring) 
Example 33
Project: cohesive-networks-vns3-vpn-monitoring   Author: trek10inc   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_c_scanstring(self):
        if not simplejson.decoder.c_scanstring:
            return
        self._test_scanstring(simplejson.decoder.c_scanstring) 
Example 34
Project: cohesive-networks-vns3-vpn-monitoring   Author: trek10inc   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_issue3623(self):
        self.assertRaises(ValueError, json.decoder.scanstring, "xxx", 1,
                          "xxx")
        self.assertRaises(UnicodeDecodeError,
                          json.encoder.encode_basestring_ascii, b("xx\xff")) 
Example 35
Project: cohesive-networks-vns3-vpn-monitoring   Author: trek10inc   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_overflow(self):
        # Python 2.5 does not have maxsize, Python 3 does not have maxint
        maxsize = getattr(sys, 'maxsize', getattr(sys, 'maxint', None))
        assert maxsize is not None
        self.assertRaises(OverflowError, json.decoder.scanstring, "xxx",
                          maxsize + 1) 
Example 36
Project: alfredToday   Author: jeeftor   File: __init__.py    MIT License 5 votes vote down vote up
def additional_tests(suite=None):
    import simplejson
    import simplejson.encoder
    import simplejson.decoder
    if suite is None:
        suite = unittest.TestSuite()
    for mod in (simplejson, simplejson.encoder, simplejson.decoder):
        suite.addTest(doctest.DocTestSuite(mod))
    suite.addTest(doctest.DocFileSuite('../../index.rst'))
    return suite 
Example 37
Project: alfredToday   Author: jeeftor   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_py_scanstring(self):
        self._test_scanstring(simplejson.decoder.py_scanstring) 
Example 38
Project: alfredToday   Author: jeeftor   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_c_scanstring(self):
        if not simplejson.decoder.c_scanstring:
            return
        self._test_scanstring(simplejson.decoder.c_scanstring) 
Example 39
Project: alfredToday   Author: jeeftor   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_issue3623(self):
        self.assertRaises(ValueError, json.decoder.scanstring, "xxx", 1,
                          "xxx")
        self.assertRaises(UnicodeDecodeError,
                          json.encoder.encode_basestring_ascii, b("xx\xff")) 
Example 40
Project: alfredToday   Author: jeeftor   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_overflow(self):
        # Python 2.5 does not have maxsize, Python 3 does not have maxint
        maxsize = getattr(sys, 'maxsize', getattr(sys, 'maxint', None))
        assert maxsize is not None
        self.assertRaises(OverflowError, json.decoder.scanstring, "xxx",
                          maxsize + 1) 
Example 41
Project: old-dotfiles   Author: hawkw   File: __init__.py    MIT License 5 votes vote down vote up
def additional_tests(suite=None):
    import simplejson
    import simplejson.encoder
    import simplejson.decoder
    if suite is None:
        suite = unittest.TestSuite()
    for mod in (simplejson, simplejson.encoder, simplejson.decoder):
        suite.addTest(doctest.DocTestSuite(mod))
    suite.addTest(doctest.DocFileSuite('../../index.rst'))
    return suite 
Example 42
Project: old-dotfiles   Author: hawkw   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_py_scanstring(self):
        self._test_scanstring(simplejson.decoder.py_scanstring) 
Example 43
Project: old-dotfiles   Author: hawkw   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_c_scanstring(self):
        if not simplejson.decoder.c_scanstring:
            return
        self._test_scanstring(simplejson.decoder.c_scanstring) 
Example 44
Project: old-dotfiles   Author: hawkw   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_issue3623(self):
        self.assertRaises(ValueError, json.decoder.scanstring, "xxx", 1,
                          "xxx")
        self.assertRaises(UnicodeDecodeError,
                          json.encoder.encode_basestring_ascii, b("xx\xff")) 
Example 45
Project: old-dotfiles   Author: hawkw   File: test_scanstring.py    MIT License 5 votes vote down vote up
def test_overflow(self):
        # Python 2.5 does not have maxsize, Python 3 does not have maxint
        maxsize = getattr(sys, 'maxsize', getattr(sys, 'maxint', None))
        assert maxsize is not None
        self.assertRaises(OverflowError, json.decoder.scanstring, "xxx",
                          maxsize + 1) 
Example 46
Project: pureapp   Author: samisalkosuo   File: __init__.py    Apache License 2.0 5 votes vote down vote up
def additional_tests(suite=None):
    import simplejson
    import simplejson.encoder
    import simplejson.decoder
    if suite is None:
        suite = unittest.TestSuite()
    for mod in (simplejson, simplejson.encoder, simplejson.decoder):
        suite.addTest(doctest.DocTestSuite(mod))
    suite.addTest(doctest.DocFileSuite('../../index.rst'))
    return suite 
Example 47
Project: pureapp   Author: samisalkosuo   File: test_scanstring.py    Apache License 2.0 5 votes vote down vote up
def test_py_scanstring(self):
        self._test_scanstring(simplejson.decoder.py_scanstring) 
Example 48
Project: pureapp   Author: samisalkosuo   File: test_scanstring.py    Apache License 2.0 5 votes vote down vote up
def test_c_scanstring(self):
        if not simplejson.decoder.c_scanstring:
            return
        self._test_scanstring(simplejson.decoder.c_scanstring) 
Example 49
Project: pureapp   Author: samisalkosuo   File: test_scanstring.py    Apache License 2.0 5 votes vote down vote up
def test_issue3623(self):
        self.assertRaises(ValueError, json.decoder.scanstring, "xxx", 1,
                          "xxx")
        self.assertRaises(UnicodeDecodeError,
                          json.encoder.encode_basestring_ascii, b("xx\xff")) 
Example 50
Project: pureapp   Author: samisalkosuo   File: test_scanstring.py    Apache License 2.0 5 votes vote down vote up
def test_overflow(self):
        # Python 2.5 does not have maxsize, Python 3 does not have maxint
        maxsize = getattr(sys, 'maxsize', getattr(sys, 'maxint', None))
        assert maxsize is not None
        self.assertRaises(OverflowError, json.decoder.scanstring, "xxx",
                          maxsize + 1)