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


Python dbm.ndbm方法代码示例

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


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

示例1: test_install_aliases

# 需要导入模块: from future.moves import dbm [as 别名]
# 或者: from future.moves.dbm import ndbm [as 别名]
def test_install_aliases(self):
        """
        Does the install_aliases() interface monkey-patch urllib etc. successfully?
        """
        from future.standard_library import remove_hooks, install_aliases
        remove_hooks()
        install_aliases()

        from collections import Counter, OrderedDict   # backported to Py2.6
        from collections import UserDict, UserList, UserString

        # Requires Python dbm support:
        # import dbm
        # import dbm.dumb
        # import dbm.gnu
        # import dbm.ndbm

        from itertools import filterfalse, zip_longest

        from subprocess import check_output    # backported to Py2.6
        from subprocess import getoutput, getstatusoutput

        from sys import intern

        # test_support may not be available (e.g. on Anaconda Py2.6):
        # import test.support

        import urllib.error
        import urllib.parse
        import urllib.request
        import urllib.response
        import urllib.robotparser

        self.assertTrue('urlopen' in dir(urllib.request)) 
开发者ID:hughperkins,项目名称:kgsgo-dataset-preprocessor,代码行数:36,代码来源:test_standard_library.py

示例2: test_future_moves_dbm

# 需要导入模块: from future.moves import dbm [as 别名]
# 或者: from future.moves.dbm import ndbm [as 别名]
def test_future_moves_dbm(self):
        """
        Do the dbm imports work?
        """
        from future.moves import dbm
        dbm.ndbm
        from future.moves.dbm import dumb
        try:
            # Is gdbm available on Py2? If so, ensure dbm.gnu is available too:
            import gdbm
        except ImportError:
            pass
        else:
            from future.moves.dbm import gnu
        from future.moves.dbm import ndbm


# Running the following tkinter test causes the following bizzare test failure:
#
# ======================================================================
# FAIL: test_open_default_encoding (future.tests.test_builtins.BuiltinTest)
# ----------------------------------------------------------------------
# Traceback (most recent call last):
#   File "/home/user/Install/BleedingEdge/python-future/future/tests/test_builtins.py", line 1219, in test_open_default_encoding
#     self.assertEqual(fp.encoding, current_locale_encoding)
# AssertionError: 'ANSI_X3.4-1968' != 'ISO-8859-1'
#
# ----------------------------------------------------------------------
#
#     def test_future_moves_tkinter(self):
#         """
#         Do the tkinter imports work?
#         """
#         from future.moves import tkinter
#         from future.moves.tkinter import dialog
#         from future.moves.tkinter import filedialog
#         from future.moves.tkinter import scrolledtext
#         from future.moves.tkinter import simpledialog
#         from future.moves.tkinter import tix
#         from future.moves.tkinter import constants
#         from future.moves.tkinter import dnd
#         from future.moves.tkinter import colorchooser
#         from future.moves.tkinter import commondialog
#         from future.moves.tkinter import font
#         from future.moves.tkinter import messagebox 
开发者ID:hughperkins,项目名称:kgsgo-dataset-preprocessor,代码行数:47,代码来源:test_standard_library.py


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