'Decorating a callable with L{deprecated} emits a warning.'

def test_deprecateEmitsWarning(self):

    version = Version('Twisted', 8, 0, 0)
    dummy = deprecated(version)(dummyCallable)
    def addStackLevel():
        dummy()
    with catch_warnings(record=True) as caught:
        simplefilter('always')
        addStackLevel()
        self.assertEqual(caught[0].category, DeprecationWarning)
        self.assertEqual(str(caught[0].message), getDeprecationWarningString(dummyCallable, version))
        self.assertEqual(caught[0].filename.rstrip('co'), __file__.rstrip('co'))
