本文整理汇总了Python中areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation.bar.bar方法的典型用法代码示例。如果您正苦于以下问题:Python bar.bar方法的具体用法?Python bar.bar怎么用?Python bar.bar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation.bar
的用法示例。
在下文中一共展示了bar.bar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_class
# 需要导入模块: from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import bar [as 别名]
# 或者: from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation.bar import bar [as 别名]
def test_class(self):
touch(os.path.join(self.subpkgname, 'bar'+os.extsep+'py'), '''\
class bar:
pass
''')
from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import bar
# Module name may be prefixed with "test.", depending on how run.
self.assertTrue(repr(bar.bar).startswith(
"<class %s.bar at 0x" % bar.__name__))
示例2: test_class
# 需要导入模块: from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import bar [as 别名]
# 或者: from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation.bar import bar [as 别名]
def test_class(self):
self._check_path_limitations('bar')
write_file(os.path.join(self.subpkgname, 'bar.py'), '''\
class bar:
pass
''')
importlib.invalidate_caches()
from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import bar
# Module name may be prefixed with "test.", depending on how run.
self.assertEqual(repr(bar.bar), "<class '%s.bar'>" % bar.__name__)
示例3: test_class
# 需要导入模块: from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import bar [as 别名]
# 或者: from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation.bar import bar [as 别名]
def test_class(self):
touch(os.path.join(self.subpkgname, 'bar'+os.extsep+'py'), '''\
class bar:
pass
''')
from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import bar
# Module name may be prefixed with "test.", depending on how run.
self.failUnless(repr(bar.bar).startswith(
"<class %s.bar at 0x" % bar.__name__))