'L{twisted.python.deprecate.deprecatedModuleAttribute} wraps a
module-level attribute in an object that emits a deprecation warning
when it is accessed the first time only, while leaving other unrelated
attributes alone.'

def test_deprecatedAttribute(self):

    deprecatedattributes.ANOTHER_ATTRIBUTE
    warningsShown = self.flushWarnings([self.test_deprecatedAttribute])
    self.assertEqual(len(warningsShown), 0)
    name = 'DEPRECATED_ATTRIBUTE'
    getattr(deprecatedattributes, name)
    warningsShown = self.flushWarnings([self.test_deprecatedAttribute])
    self.assertEqual(len(warningsShown), 1)
    self.assertIs(warningsShown[0]['category'], DeprecationWarning)
    self.assertEqual(warningsShown[0]['message'], self._getWarningString(name))
