code: def test_get_result_filter_arg_vs_config():
      # just tests that we would be obtaining the same constraints via
      # cmdline argument or via config variable.  With cmdline overloading
      # config
      f = _get_result_filter
      eq_(f(_new_args()), None)  # by default, no filter
  
      for v in "success", "failure", "ok", "notneeded", "error":
          cargs = f(_new_args(common_report_status=v))
          assert cargs is not None
          with patch_config({"datalad.runtime.report-status": v}):
              ccfg = f(_new_args())
              ccfg_none = f(_new_args(common_report_status="all"))
          # cannot compare directly but at least could verify based on repr
          print("%s -> %s" % (v, repr(cargs)))
          eq_(repr(cargs), repr(ccfg))
          # and if 'all' - none filter
          eq_(None, ccfg_none)
  
          # and we overload the "error" in config
          with patch_config({"datalad.runtime.report-status": "error"}):
              cargs_overload = f(_new_args(common_report_status=v))
          eq_(repr(cargs), repr(cargs_overload))
  
file_path: datalad/datalad/cli/tests/test_exec.py
imports: import argparse
  from argparse import Namespace
  import pytest
  from datalad.interface.base import Interface
  from datalad.support.param import Parameter
  from datalad.tests.utils_pytest import assert_not_in, eq_, patch_config
  from datalad.utils import updated
  from ..exec import _get_result_filter, call_from_parser
  from ..parser import parser_add_common_options, setup_parser_for_interface
label_desc: Use image node_id 7 for calling a global function with example usage: test_get_result_filter_arg_vs_config() without return types