Skip to content

Commit 387a29c

Browse files
committed
Add urlopen test
1 parent 7b439d3 commit 387a29c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/io/test_common.py

+8
Original file line numberDiff line numberDiff line change
@@ -417,3 +417,11 @@ def test_is_fsspec_url():
417417
assert not icom.is_fsspec_url("random:pandas/somethingelse.com")
418418
assert not icom.is_fsspec_url("/local/path")
419419
assert not icom.is_fsspec_url("relative/local/path")
420+
421+
422+
def test_urlopen_headers():
423+
headers = {"User-Agent": "Pandas 1.1.0"}
424+
# this returns the User-Agent
425+
url = "http://ifconfig.me/ua"
426+
r = icom.urlopen(url, headers=headers)
427+
assert r.read().decode("utf-8") == headers["User-Agent"]

0 commit comments

Comments
 (0)