code: def test_to_dict(self):
      r = Resources(cpus=0.1, ram=2048, disk=1024, gpus=1)
      assert r.to_dict() == {
          "cpus": {"name": "CPU", "qty": 0.1, "units_str": "core(s)"},
          "ram": {"name": "RAM", "qty": 2048, "units_str": "MB"},
          "disk": {"name": "Disk", "qty": 1024, "units_str": "MB"},
          "gpus": {"name": "GPU", "qty": 1, "units_str": "gpu(s)"},
      }
  
imports: from __future__ import annotations
  from airflow.utils.operator_resources import Resources
label_desc: Use image node_id 2 for calling the TestResources obj's underlying member method code with example usage: obj.test_to_dict() without return types