def test_KEX_DH_GEX_GROUP(self):
        """
        Test that the KEX_DH_GEX_GROUP message results in a
        KEX_DH_GEX_INIT message with the client's Diffie-Hellman public key.
        """
        self.test_KEXINIT_groupexchange()
        self.proto.ssh_KEX_DH_GEX_GROUP(
            b'\x00\x00\x00\x03\x00\xfe\xf3\x00\x00\x00\x01\x02')
        self.assertEqual(self.proto.p, 65267)
        self.assertEqual(self.proto.g, 2)
        x = self.proto.dhSecretKey.private_numbers().x
        self.assertEqual(common.MP(x)[5:], b'\x99' * 2)
        self.assertEqual(self.proto.dhSecretKeyPublicMP,
                         common.MP(pow(2, x, 65267)))
        self.assertEqual(self.packets[1:], [(transport.MSG_KEX_DH_GEX_INIT,
                                             self.proto.dhSecretKeyPublicMP)])

        Test that the KEX_DH_GEX_GROUP message results in a
        KEX_DH_GEX_INIT message with the client's Diffie-Hellman public key.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_transport.py