本文整理汇总了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))
示例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