code: def test_request_args():
      request = Request.fake("/foo?multi=1&multi=2&single=3")
      assert "1" == request.args.get("multi")
      assert "3" == request.args.get("single")
      assert "1" == request.args["multi"]
      assert "3" == request.args["single"]
      assert ["1", "2"] == request.args.getlist("multi")
      assert [] == request.args.getlist("missing")
      assert "multi" in request.args
      assert "single" in request.args
      assert "missing" not in request.args
      expected = ["multi", "single"]
      assert expected == list(request.args.keys())
      for i, key in enumerate(request.args):
          assert expected[i] == key
      assert 2 == len(request.args)
      with pytest.raises(KeyError):
          request.args["missing"]
  
file_path: datasette/tests/test_internals_request.py
imports: from datasette.utils.asgi import Request
  import json
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_request_args() without return types