'Instantiating L{HostnameEndpoint} with a reactor that does not
provide L{IReactorPluggableResolver} emits a deprecation warning.'

def test_deprecation(self):

    mreactor = MemoryReactor()
    clientFactory = object()
    self.createClientEndpoint(mreactor, clientFactory)
    warnings = self.flushWarnings()
    self.assertEqual(1, len(warnings))
    self.assertIs(DeprecationWarning, warnings[0]['category'])
    self.assertTrue(warnings[0]['message'].startswith('Passing    HostnameEndpoint    a    reactor    that    does    not    provide    IReactorPluggableNameResolver    (twisted.test.proto_helpers.MemoryReactorClock)    was    deprecated    in    Twisted    17.5.0;    please    use    a    reactor    that    provides    IReactorPluggableNameResolver    instead'))
