code: def test_ports_override(self):
      conf = TaskConfiguration(commands=[], ports=["80"])
      modified, args = apply_args(
          conf, ["-p", "8000:80", "--port", "8001:8000"]
      )
      conf.ports = [
          PortMapping(local_port=8000, container_port=80),
          PortMapping(local_port=8001, container_port=8000),
      ]
      assert modified.dict() == conf.dict()
  
file_path: dstack/src/tests/_internal/cli/services/configurators/test_run.py
imports: import argparse
  from typing import List, Tuple
  import pytest
  from dstack._internal.cli.services.configurators.run import run_configurators_mapping
  from dstack._internal.core.errors import ConfigurationError
  from dstack._internal.core.models.configurations import BaseConfiguration, PortMapping, TaskConfiguration
label_desc: Use image node_id 5 for calling the TestRunConfigurator obj's underlying member method code with example usage: obj.test_ports_override() without return types