本文整理汇总了Python中twisted.trial.util.findObject函数的典型用法代码示例。如果您正苦于以下问题:Python findObject函数的具体用法?Python findObject怎么用?Python findObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了findObject函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_deprecation
def test_deprecation(self):
"""
Calling L{findObject} results in a deprecation warning
"""
util.findObject('')
warningsShown = self.flushWarnings()
self.assertEquals(len(warningsShown), 1)
self.assertIdentical(warningsShown[0]['category'], DeprecationWarning)
self.assertEquals(warningsShown[0]['message'],
"twisted.trial.util.findObject was deprecated "
"in Twisted 10.1.0: Please use "
"twisted.python.reflect.namedAny instead.")
示例2: test_findObjectExist
def test_findObjectExist(self):
alpha1 = util.findObject('goodpackage.test_sample.AlphabetTest')
from goodpackage import test_sample
self.failUnlessEqual(alpha1, (True, test_sample.AlphabetTest))
示例3: test_findNonexistentObject
def test_findNonexistentObject(self):
self.failUnlessEqual(util.findObject(
'goodpackage.test_sample.doesnt')[0], False)
self.failUnlessEqual(util.findObject(
'goodpackage.test_sample.AlphabetTest.doesntexist')[0], False)
示例4: test_findNonexistentModule
def test_findNonexistentModule(self):
self.failUnlessEqual(util.findObject('package.doesntexist')[0], False)
示例5: test_importNonexistentPackage
def test_importNonexistentPackage(self):
self.failUnlessEqual(util.findObject('doesntexist')[0], False)
示例6: test_importModule
def test_importModule(self):
test_sample2 = util.findObject('goodpackage.test_sample')
from goodpackage import test_sample
self.failUnlessEqual((True, test_sample), test_sample2)
示例7: test_importPackage
def test_importPackage(self):
package1 = util.findObject('package')
import package as package2
self.failUnlessEqual(package1, (True, package2))
示例8: test_importModule
def test_importModule(self):
test_sample2 = util.findObject("goodpackage.test_sample")
from goodpackage import test_sample
self.assertEqual((True, test_sample), test_sample2)
示例9: test_importPackage
def test_importPackage(self):
package1 = util.findObject("package")
import package as package2
self.assertEqual(package1, (True, package2))
示例10: test_findObjectExist
def test_findObjectExist(self):
alpha1 = util.findObject("goodpackage.test_sample.AlphabetTest")
from goodpackage import test_sample
self.assertEqual(alpha1, (True, test_sample.AlphabetTest))
示例11: test_findNonexistentObject
def test_findNonexistentObject(self):
self.assertEqual(util.findObject("goodpackage.test_sample.doesnt")[0], False)
self.assertEqual(util.findObject("goodpackage.test_sample.AlphabetTest.doesntexist")[0], False)
示例12: test_findNonexistentModule
def test_findNonexistentModule(self):
self.assertEqual(util.findObject("package.doesntexist")[0], False)
示例13: test_importNonexistentPackage
def test_importNonexistentPackage(self):
self.assertEqual(util.findObject("doesntexist")[0], False)