code: def test_yesno():
      for expected_value, defaults in {
          True: ("yes", True),
          False: ("no", False),
      }.items():
          for d in defaults:
              with patch_getpass(return_value=""):
                  out = StringIO()
                  response = DialogUI(out=out).yesno("?", default=d)
                  eq_(response, expected_value)
  
file_path: datalad/datalad/ui/tests/test_dialog.py
imports: import builtins
  from io import StringIO
  from unittest.mock import call, patch
  import pytest
  from datalad.ui.progressbars import progressbars
  from datalad.utils import swallow_logs
  from ...tests.utils_pytest import assert_in, assert_not_in, assert_raises, assert_re_in, eq_, ok_endswith, ok_startswith
  from ..dialog import ConsoleLog, DialogUI, IPythonUI
label_desc: Use image node_id 3 for calling a global function with example usage: test_yesno() without return types