def test_early_data_enabled(self):
        # Given a server to scan that supports early data
        with ModernOpenSslServer(max_early_data=256) as server:
            server_location = ServerNetworkLocationViaDirectConnection(
                hostname=server.hostname,
                ip_address=server.ip_address,
                port=server.port)
            server_info = ServerConnectivityTester().perform(server_location)

            # When testing for early data support, it succeeds
            result: EarlyDataScanResult = EarlyDataImplementation.perform(
                server_info)

        # And the right result is returned
        assert result.supports_early_data
    def test_early_data_disabled_no_tls_1_3(self):
        # Given a server to scan that does NOT support early data because it does not support TLS 1.3
        with LegacyOpenSslServer() as server:
            server_location = ServerNetworkLocationViaDirectConnection(
                hostname=server.hostname,
                ip_address=server.ip_address,
                port=server.port)
            server_info = ServerConnectivityTester().perform(server_location)

            # When testing for early data support, it succeeds
            result: EarlyDataScanResult = EarlyDataImplementation.perform(
                server_info)

        # And the right result is returned
        assert not result.supports_early_data