예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 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)
예제 #5
0
 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)
예제 #6
0
 class testcase(cls, SynchronousTestCase):
     __module__ = cls.__module__
     if reactor in cls.skippedReactors:
         skip = cls.skippedReactors[reactor]
     try:
         reactorFactory = namedAny(reactor)
     except:
         skip = Failure().getErrorMessage()
예제 #7
0
 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__)
예제 #8
0
 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__)
예제 #9
0
 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)
예제 #10
0
 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)
예제 #11
0
 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)