Skip to content

Commit

Permalink
Added test which checks that cookie might be built from a list of tup…
Browse files Browse the repository at this point in the history
…les (encode#1209)
  • Loading branch information
cdeler committed Aug 21, 2020
1 parent 15c1e42 commit 4dae142
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/models/test_cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,13 @@ def test_multiple_set_cookie():
cookies.extract_cookies(response)

assert len(cookies) == 2


def test_cookies_can_be_a_list_of_tuples():
cookies_val = [("name1", "val1"), ("name2", "val2")]

cookies = httpx.Cookies(cookies_val)

assert len(cookies.items()) == 2
for k, v in cookies_val:
assert cookies[k] == v

0 comments on commit 4dae142

Please sign in to comment.