code: def test_write(capsys):
      """Test that ui.write works."""
      console = Console(enable=True)
      message = "hello world"
      console.write(message)
      console.error_write(message)
  
      captured = capsys.readouterr()
      assert captured.out == f"{message}\n"
      assert captured.err == f"{message}\n"
  
imports: import datetime
  import textwrap
  import pytest
  from dvc.ui import Console
label_desc: Use image node_id 1 for calling a global function with example usage: test_write(capsys) without return types