'Assert that accessing the given class was deprecated.
@param klass: The class being deprecated.
@type klass: L{str}'

def _testDeprecatedClass(self, klass):

    getattr(client, klass)
    warningInfo = self.flushWarnings()
    self.assertEqual(len(warningInfo), 1)
    self.assertEqual(warningInfo[0]['category'], DeprecationWarning)
    self.assertEqual(warningInfo[0]['message'], 'twisted.web.client.{}    was    deprecated    in    Twisted    16.7.0:    please    use    https://pypi.org/project/treq/    or    twisted.web.client.Agent    instead'.format(klass))
