'L{twisted.python.deprecate._DeprecatedAttribute} correctly sets its
__name__ to match that of the deprecated attribute and emits a warning
when the original attribute value is accessed.'

def test_deprecatedAttributeHelper(self):

    name = 'ANOTHER_DEPRECATED_ATTRIBUTE'
    setattr(deprecatedattributes, name, 42)
    attr = deprecate._DeprecatedAttribute(deprecatedattributes, name, self.version, self.message)
    self.assertEqual(attr.__name__, name)
    def addStackLevel():
        attr.get()
    addStackLevel()
    warningsShown = self.flushWarnings([self.test_deprecatedAttributeHelper])
    self.assertIs(warningsShown[0]['category'], DeprecationWarning)
    self.assertEqual(warningsShown[0]['message'], self._getWarningString(name))
    self.assertEqual(len(warningsShown), 1)
