diff --git a/pandas/tests/io/test_common.py b/pandas/tests/io/test_common.py index ede8d61490778..d216024b2fa33 100644 --- a/pandas/tests/io/test_common.py +++ b/pandas/tests/io/test_common.py @@ -417,3 +417,11 @@ def test_is_fsspec_url(): assert not icom.is_fsspec_url("random:pandas/somethingelse.com") assert not icom.is_fsspec_url("/local/path") assert not icom.is_fsspec_url("relative/local/path") + + +def test_urlopen_headers(): + headers = {"User-Agent": "Pandas 1.1.0"} + # this returns the User-Agent + url = "http://ifconfig.me/ua" + r = icom.urlopen(url, headers=headers) + assert r.read().decode("utf-8") == headers["User-Agent"]