当前位置: 首页>>代码示例>>Python>>正文


Python simplejson.decoder方法代码示例

本文整理汇总了Python中simplejson.decoder方法的典型用法代码示例。如果您正苦于以下问题:Python simplejson.decoder方法的具体用法?Python simplejson.decoder怎么用?Python simplejson.decoder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在simplejson的用法示例。


在下文中一共展示了simplejson.decoder方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: additional_tests

# 需要导入模块: import simplejson [as 别名]
# 或者: from simplejson import decoder [as 别名]
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 
开发者ID:Tautulli,项目名称:Tautulli,代码行数:19,代码来源:__init__.py

示例2: additional_tests

# 需要导入模块: import simplejson [as 别名]
# 或者: from simplejson import decoder [as 别名]
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 
开发者ID:gkudos,项目名称:qgis-cartodb,代码行数:12,代码来源:__init__.py

示例3: test_py_scanstring

# 需要导入模块: import simplejson [as 别名]
# 或者: from simplejson import decoder [as 别名]
def test_py_scanstring(self):
        self._test_scanstring(simplejson.decoder.py_scanstring) 
开发者ID:gkudos,项目名称:qgis-cartodb,代码行数:4,代码来源:test_scanstring.py

示例4: test_c_scanstring

# 需要导入模块: import simplejson [as 别名]
# 或者: from simplejson import decoder [as 别名]
def test_c_scanstring(self):
        if not simplejson.decoder.c_scanstring:
            return
        self._test_scanstring(simplejson.decoder.c_scanstring) 
开发者ID:gkudos,项目名称:qgis-cartodb,代码行数:6,代码来源:test_scanstring.py

示例5: test_issue3623

# 需要导入模块: import simplejson [as 别名]
# 或者: from simplejson import decoder [as 别名]
def test_issue3623(self):
        self.assertRaises(ValueError, json.decoder.scanstring, "xxx", 1,
                          "xxx")
        self.assertRaises(UnicodeDecodeError,
                          json.encoder.encode_basestring_ascii, b("xx\xff")) 
开发者ID:gkudos,项目名称:qgis-cartodb,代码行数:7,代码来源:test_scanstring.py

示例6: test_overflow

# 需要导入模块: import simplejson [as 别名]
# 或者: from simplejson import decoder [as 别名]
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) 
开发者ID:gkudos,项目名称:qgis-cartodb,代码行数:8,代码来源:test_scanstring.py

示例7: test_c_scanstring

# 需要导入模块: import simplejson [as 别名]
# 或者: from simplejson import decoder [as 别名]
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)) 
开发者ID:Tautulli,项目名称:Tautulli,代码行数:8,代码来源:test_scanstring.py


注:本文中的simplejson.decoder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。