code: def test_gitignore_basic(tmp_dir, dvc, scm):
      tmp_dir.gen("foo", "foo")
      assert not os.path.exists(scm.GITIGNORE)
  
      tmp_dir.dvc_gen("file1", "random text1", commit="add file1")
      tmp_dir.dvc_gen("file2", "random text2", commit="add file2")
      dvc.run(
          cmd="cp foo file3",
          deps=["foo"],
          outs_no_cache=["file3"],
          name="cp-foo-file3",
      )
      assert get_gitignore_content() == ["/file1", "/file2"]
  
imports: import logging
  import os
  import shutil
  import stat
  import textwrap
  import pytest
  from dvc.cli import main
  from dvc.dvcfile import PROJECT_FILE, load_file
  from dvc.exceptions import CheckoutError, CheckoutErrorSuggestGit, NoOutputOrStageError
  from dvc.fs import system
  from dvc.stage.exceptions import StageFileDoesNotExistError
  from dvc.utils import relpath
  from dvc.utils.fs import remove
  from tests.utils import get_gitignore_content
label_desc: Use image node_id 6 for calling a global function with example usage: test_gitignore_basic(tmp_dir, dvc, scm) without return types