code: def test_view_mocked(
      mocker, mock_platform, mock_popen, mock_startfile, quiet
  ):
      assert graphviz.view("nonfilepath", quiet=quiet) is None
  
      if mock_platform == "windows":
          mock_startfile.assert_called_once_with("nonfilepath")
          return
  
      if quiet:
          kwargs = {"stderr": subprocess.DEVNULL}
      else:
          kwargs = {}
  
      if mock_platform == "darwin":
          mock_popen.assert_called_once_with(
              ["open", "nonfilepath"], **kwargs
          )
      elif mock_platform in ("linux", "freebsd"):
          mock_popen.assert_called_once_with(
              ["xdg-open", "nonfilepath"], **kwargs
          )
      else:
          raise RuntimeError
  
imports: import subprocess
  import pytest
  import graphviz
label_desc: Use image node_id 2 for calling a global function with example usage: test_view_mocked(mocker, mock_platform, mock_popen, mock_startfile, quiet) without return types