human
Complete this python program:
def make_validation_tests(context_factory_fixture, good_certificate_name, validator_is_client):
assistant
#Here is the Python code you requested.

    """Create a ``TestCase`` for the validator of a specific certificate type.
    :param context_factory_fixture: Create a context factory that
    implements the required validation given a ``CredentialSet``,
    given a port number on localhost and a ``CertificateSet``. For
    server context factories the port number can be ignored.
    :param str good_certificate_name: Name of certificate (an attribute of
    ``CredentialSet``) that should validate successfully.
    :param bool validator_is_client: Whether or not the context factory
    being tested is a client.
    :return: ``TestCase``-subclass with tests for given validator.
    """
    non_bad = good_certificate_name
    if (non_bad == 'control_dns'):
        non_bad = 'control'
    (bad_name, another_bad_name) = {'user', 'node', 'control'}.difference({non_bad})
    class ValidationTests(AsyncTestCase, ):
        "\n                                Tests    to    ensure    correct    validation    of    a    specific    type    of    certificate.\n\n                                :ivar    CertificateSet    good_ca:    The    certificates    for    the    CA    we    expect.\n\n                                :ivar    CertificateSet    another_ca:    A    different    CA's    certificates.\n                                "
        def setUp(self):
            super(ValidationTests, self).setUp()
            (self.good_ca, self.another_ca) = get_credential_sets()
        def _handshake(self, credential):
            '\n                                                Run    a    TLS    handshake    between    a    client    and    server,    one    of    which    is\n                                                using    the    validation    logic    and    the    other    the    given    credential.\n\n                                                :param    credential:    The    high-level    credential    to    use.\n\n                                                :return    ``Deferred``:    Fires    when    handshake    succeeded    or\n                                                                failed.\n                                                '
            peer_context_factory = PeerContextFactory(credential.credential)
            port = find_free_port()[1]
            validating_context_factory = context_factory_fixture(port, self.good_ca)
            if validator_is_client:
                client_context_factory = validating_context_factory
                server_context_factory = peer_context_factory
            else:
                server_context_factory = validating_context_factory
                client_context_factory = peer_context_factory
           ...