code: def test_validate_parameters_port_closed(
      is_port_open, is_hostname_valid
  ):
      is_hostname_valid.return_value = True
      is_port_open.return_value = False
  
      properties = {
          "parameters": {
              "host": "localhost",
              "port": 5432,
              "username": "username",
              "password": "password",
              "database": "dbname",
              "query": {"sslmode": "verify-full"},
          }
      }
      with app.app_context():
          errors = BasicParametersMixin.validate_parameters(properties)
          assert errors == [
              SupersetError(
                  message="The port is closed.",
                  error_type=SupersetErrorType.CONNECTION_PORT_CLOSED_ERROR,
                  level=ErrorLevel.ERROR,
                  extra={
                      "invalid": ["port"],
                      "issue_codes": [
                          {
                              "code": 1008,
                              "message": "Issue 1008 - The port is closed.",
                          }
                      ],
                  },
              )
          ]
  
imports: import datetime
  from unittest import mock
  import pytest
  from superset.connectors.sqla.models import TableColumn
  from superset.db_engine_specs import load_engine_specs
  from superset.db_engine_specs.base import BaseEngineSpec, BasicParametersMixin, builtin_time_grains, LimitMethod
  from superset.db_engine_specs.mysql import MySQLEngineSpec
  from superset.db_engine_specs.sqlite import SqliteEngineSpec
  from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
  from superset.sql_parse import ParsedQuery
  from superset.utils.database import get_example_database
  from tests.integration_tests.db_engine_specs.base_tests import TestDbEngineSpec
  from tests.integration_tests.test_app import app
  from ..fixtures.birth_names_dashboard import load_birth_names_dashboard_with_slices, load_birth_names_data
  from ..fixtures.energy_dashboard import load_energy_table_data, load_energy_table_with_slice
  from ..fixtures.pyodbcRow import Row
label_desc: Use image node_id 9 for calling a global function with example usage: test_validate_parameters_port_closed(is_port_open, is_hostname_valid) without return types