code: def test_add_nodes_to_group(self):
      program = lp_program.Program("foo")
      nodes_foo = [
          mock.Mock(autospec=base.Node),
          mock.Mock(autospec=base.Node),
      ]
      with program.group("foo"):
          for node in nodes_foo:
              program.add_node(node)
      nodes_bar = [
          mock.Mock(autospec=base.Node),
          mock.Mock(autospec=base.Node),
      ]
      with program.group("bar"):
          for node in nodes_bar:
              program.add_node(node)
      self.assertEqual(program.groups["foo"], nodes_foo)
      self.assertEqual(program.groups["bar"], nodes_bar)
  
file_path: launchpad/launchpad/program_test.py
imports: from unittest import mock
  from absl.testing import absltest
  from launchpad import program
  from launchpad.nodes import base
label_desc: Use image node_id 2 for calling the ProgramTest obj's underlying member method code with example usage: obj.test_add_nodes_to_group() without return types