code: def test_view_args() -> None:
      db = bub.DummyWebBrowser
      bub.DummyWebBrowser = _RecordingWebBrowser
  
      # test http locations used as-is
      bub.view("http://foo", browser="none")
      assert _open_args == (
          ("http://foo",),
          {"autoraise": True, "new": 0},
      )
  
      # test non-http locations treated as local files
      bub.view("/foo/bar", browser="none")
      if sys.platform == "win32":
          assert _open_args == (
              (
                  "file://"
                  + os.path.splitdrive(os.getcwd())[0]
                  + "\\foo\\bar",
              ),
              {"autoraise": True, "new": 0},
          )
      else:
          assert _open_args == (
              ("file:///foo/bar",),
              {"autoraise": True, "new": 0},
          )
  
      # test autoraise passed to open
      bub.view("http://foo", browser="none", autoraise=False)
      assert _open_args == (
          ("http://foo",),
          {"autoraise": False, "new": 0},
      )
  
      # test handling of new values
      bub.view("http://foo", browser="none", new="same")
      assert _open_args == (
          ("http://foo",),
          {"autoraise": True, "new": 0},
      )
      bub.view("http://foo", browser="none", new="window")
      assert _open_args == (
          ("http://foo",),
          {"autoraise": True, "new": 1},
      )
      bub.view("http://foo", browser="none", new="tab")
      assert _open_args == (
          ("http://foo",),
          {"autoraise": True, "new": 2},
      )
  
      bub.DummyWebBrowser = db
  
file_path: bokeh/tests/unit/bokeh/util/test_browser.py
imports: from __future__ import annotations
  import pytest
  import os
  import sys
  import webbrowser
  from unittest.mock import MagicMock, patch
  from tests.support.util.env import envset
  import bokeh.util.browser
label_desc: Use image node_id 8 for calling a global function with example usage: test_view_args() without return types