def test_pycurl_user_agent(self):
"""If provided, the user-agent is set in the request."""
curl = CurlStub(b"result")
result = fetch(
"http://example.com", curl=curl, user_agent="user-agent")
self.assertEqual(result, b"result")
self.assertEqual(b"user-agent", curl.options[pycurl.USERAGENT])
评论列表
文章目录