Skip to content

Commit

Permalink
Add urlopen test
Browse files Browse the repository at this point in the history
  • Loading branch information
Antetokounpo committed Oct 3, 2020
1 parent 7432d88 commit 4538944
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pandas/tests/io/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit 4538944

Please sign in to comment.