def test_docker_path_translation_integration():
    """Test path translation in a simulated Docker environment"""

    with tempfile.TemporaryDirectory() as tmpdir:
        # Set up directories
        host_workspace = Path(tmpdir) / "host_workspace"
        host_workspace.mkdir()
        container_workspace = Path(tmpdir) / "container_workspace"
        container_workspace.mkdir()

        # Create a test file structure
        (host_workspace / "src").mkdir()
        test_file = host_workspace / "src" / "test.py"
        test_file.write_text("# test file")

        # Set environment variables and reload the module
        original_env = os.environ.copy()
        try:
            os.environ["WORKSPACE_ROOT"] = str(host_workspace)

            # Reload the module to pick up new environment variables
            importlib.reload(utils.file_utils)

            # Mock the CONTAINER_WORKSPACE to point to our test directory
            utils.file_utils.CONTAINER_WORKSPACE = container_workspace

            # Test the translation
            from utils.file_utils import translate_path_for_environment

            # This should translate the host path to container path
            host_path = str(test_file)
            result = translate_path_for_environment(host_path)

            # Verify the translation worked
            expected = str(container_workspace / "src" / "test.py")
            assert result == expected

        finally:
            # Restore original environment
            os.environ.clear()
            os.environ.update(original_env)
            importlib.reload(utils.file_utils)
Test path translation in a simulated Docker environment
tests/test_docker_path_integration.py