code: def test_complete_custom_completers(self, argcomplete_on):
      app = ArgcompleteApp()
      # test pre-defined completers for Bool/Enum
      assert set(
          self.run_completer(app, "app --Application.log_level=")
      ) > {"DEBUG", "INFO"}
      assert set(
          self.run_completer(app, "app --ArgcompleteApp.show_config ")
      ) == {
          "0",
          "1",
          "true",
          "false",
      }
  
      # test custom completer and mid-command completions
      class CustomCls(Configurable):
          val = Unicode().tag(
              config=True,
              argcompleter=argcomplete.completers.ChoicesCompleter(
                  ["foo", "bar"]
              ),
          )
  
      class CustomApp(ArgcompleteApp):
          classes = [CustomCls]
          aliases = {("v", "val"): "CustomCls.val"}
  
      app = CustomApp()
      assert self.run_completer(app, "app --val ") == ["foo", "bar"]
      assert self.run_completer(app, "app --val=") == ["foo", "bar"]
      assert self.run_completer(app, "app -v ") == ["foo", "bar"]
      assert self.run_completer(app, "app -v=") == ["foo", "bar"]
      assert self.run_completer(app, "app --CustomCls.val  ") == [
          "foo",
          "bar",
      ]
      assert self.run_completer(app, "app --CustomCls.val=") == [
          "foo",
          "bar",
      ]
      completions = self.run_completer(
          app, "app --val= abc xyz", point=10
      )
      # fixed in argcomplete >= 2.0 to return latter below
      assert completions == [
          "--val=foo",
          "--val=bar",
      ] or completions == ["foo", "bar"]
      assert self.run_completer(
          app, "app --val  --log-level=", point=10
      ) == ["foo", "bar"]
  
imports: import io
  import os
  import typing
  import pytest
  from traitlets import Unicode
  from traitlets.config.application import Application
  from traitlets.config.configurable import Configurable
  from traitlets.config.loader import KVArgParseConfigLoader
label_desc: Use image node_id 4 for calling the TestArgcomplete obj's underlying member method code with example usage: obj.test_complete_custom_completers(argcomplete_on) without return types