code: def test_routes(routes, path, expected_name, expected_matches):
      match, view = resolve_routes(routes, path)
      if expected_name is None:
          assert match is None
      else:
          assert (
              view.__name__ == expected_name
              or view.view_class.__name__ == expected_name
          )
          assert match.groupdict() == expected_matches
  
imports: from datasette.app import Datasette, Database
  from datasette.utils import resolve_routes
  import pytest
  import pytest_asyncio
label_desc: Use image node_id 2 for calling a global function with example usage: test_routes(routes, path, expected_name, expected_matches) without return types