control 'python311' do
  # Get node attributes
  nodes_dir = '/tmp/kitchen/nodes'
  output = command("ls #{nodes_dir}").stdout.strip
  node_json = "#{nodes_dir}/#{output}"
  node = json(node_json).params

  case node['automatic']['platform_family']
  when 'debian'
    if node['automatic']['platform_version'].to_s.start_with?('12')

      # Required packages
      packages = %w(
        python3.11
        python3.11-venv
        python3-pip
        python3-yaml
      )

      packages.each do |package|
        describe package(package) do
          it { should be_installed }
        end
      end
    end
  end
end
