def test_namedAnyClassLookup(self): """ L{namedAny} should return the class object for the name it is passed. """ self.assertIdentical( reflect.namedAny("twisted.python.test.test_reflectpy3.Summer"), Summer)
def test_namedAnyPackageLookup(self): """ L{namedAny} should return the package object for the name it is passed. """ import twisted.python self.assertIdentical( reflect.namedAny("twisted.python"), twisted.python)
def test_namedAnyModuleLookup(self): """ L{namedAny} should return the module object for the name it is passed. """ from twisted.python import monkey self.assertIdentical( reflect.namedAny("twisted.python.monkey"), monkey)
def test_namedAnyPackageLookup(self): """ L{namedAny} should return the package object for the name it is passed. """ import twisted.python self.assertIdentical(reflect.namedAny("twisted.python"), twisted.python)
class testcase(cls, SynchronousTestCase): __module__ = cls.__module__ if reactor in cls.skippedReactors: skip = cls.skippedReactors[reactor] try: reactorFactory = namedAny(reactor) except: skip = Failure().getErrorMessage()
def test_namedAnySecondAttributeLookup(self): """ L{namedAny} should return the object an attribute of an object which itself was an attribute of a non-module, non-package object is bound to for the name it is passed. """ self.assertIdentical( reflect.namedAny("twisted.python.test.test_reflectpy3." "Summer.reallySet.__doc__"), Summer.reallySet.__doc__)
def test_namedAnySecondAttributeLookup(self): """ L{namedAny} should return the object an attribute of an object which itself was an attribute of a non-module, non-package object is bound to for the name it is passed. """ self.assertIdentical( reflect.namedAny( "twisted.python.test.test_reflectpy3." "Summer.reallySet.__doc__"), Summer.reallySet.__doc__)
def test_namedAnyAttributeLookup(self): """ L{namedAny} should return the object an attribute of a non-module, non-package object is bound to for the name it is passed. """ # Note - not assertEqual because unbound method lookup creates a new # object every time. This is a foolishness of Python's object # implementation, not a bug in Twisted. self.assertEqual( reflect.namedAny( "twisted.python.test.test_reflectpy3.Summer.reallySet"), Summer.reallySet)
def test_namedAnyModuleLookup(self): """ L{namedAny} should return the module object for the name it is passed. """ from twisted.python import monkey self.assertIdentical(reflect.namedAny("twisted.python.monkey"), monkey)