code: def test_with_simple_list_data(tmp_dir, dvc):
      """Testing a simple non-nested list as a foreach data"""
      resolver = DataResolver(dvc, tmp_dir.fs_path, {})
  
      context = Context()
      data = {
          "foreach": ["foo", "bar", "baz"],
          "do": {"cmd": "echo ${item}"},
      }
      definition = ForeachDefinition(resolver, context, "build", data)
  
      assert definition.resolve_one("foo") == {
          "build@foo": {"cmd": "echo foo"}
      }
      assert definition.resolve_one("bar") == {
          "build@bar": {"cmd": "echo bar"}
      }
      # check that `foreach` item-key replacement didnot leave any leftovers.
      assert not context
      assert not resolver.tracked_vars["build@foo"]
      assert not resolver.tracked_vars["build@bar"]
  
imports: import os
  import pytest
  from dvc.parsing import DEFAULT_PARAMS_FILE, DataResolver, ForeachDefinition
  from dvc.parsing.context import Context
label_desc: Use image node_id 1 for calling a global function with example usage: test_with_simple_list_data(tmp_dir, dvc) without return types