code: def test_declare_resource_group(batch):
      with tempfile.NamedTemporaryFile("w") as output_file:
          msg = "hello world"
          b = batch
          j = b.new_job()
          j.declare_resource_group(ofile={"log": "{root}.txt"})
          assert isinstance(j.ofile, ResourceGroup)
          j.command(f'printf "{msg}" > {j.ofile.log}')
          b.write_output(j.ofile.log, output_file.name)
          b.run()
  
          assert open(output_file.name).read() == msg
  
imports: from typing import AsyncIterator
  import os
  import pytest
  import subprocess
  import tempfile
  from hailtop import pip_version
  from hailtop.batch import Batch, LocalBackend, ResourceGroup
  from hailtop.batch.resource import JobResourceFile
  from hailtop.batch.utils import concatenate
label_desc: Use image node_id 12 for calling a global function with example usage: test_declare_resource_group(batch) without return types