def test_explicitAllowedMethods(self):
        """
        The L{UnsupportedMethod} raised by L{Resource.render} for an unsupported
        request method has a C{allowedMethods} attribute set to the value of the
        C{allowedMethods} attribute of the L{Resource}, if it has one.
        """
        expected = [b'GET', b'HEAD', b'PUT']
        resource = Resource()
        resource.allowedMethods = expected
        request = DummyRequest([])
        request.method = b'FICTIONAL'
        exc = self.assertRaises(UnsupportedMethod, resource.render, request)
        self.assertEqual(set(expected), set(exc.allowedMethods))

        The L{UnsupportedMethod} raised by L{Resource.render} for an unsupported
        request method has a C{allowedMethods} attribute set to the value of the
        C{allowedMethods} attribute of the L{Resource}, if it has one.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_resource.py