Skip to content

Commit

Permalink
Added tests for the request_chunked() case
Browse files Browse the repository at this point in the history
  • Loading branch information
robermorales committed May 24, 2019
1 parent 3a285b9 commit 5e68837
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test/with_dummyserver/test_connectionpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,13 @@ def test_mixed_case_hostname(self):
response = pool.request('GET', "http://LoCaLhOsT:%d/" % self.port)
self.assertEqual(response.status, 200)

def test_broken_pipe_ignore(self):
resp = self.pool.urlopen('POST', '/admin', chunked=False)
assert resp.status == 401

resp = self.pool.urlopen('POST', '/admin', chunked=True)
assert resp.status == 401


class TestRetry(HTTPDummyServerTestCase):
def setUp(self):
Expand Down Expand Up @@ -1057,13 +1064,5 @@ def test_pool_size_redirect(self):
assert self.pool.num_connections == 1


class TestBrokenPipeIgnore(HTTPDummyServerTestCase):
def setUp(self):
self.pool = HTTPConnectionPool(self.host, self.port)

def test_broken_pipe_ignore(self):
resp = self.pool.urlopen('POST', '/admin')
assert resp.status == 401

if __name__ == '__main__':
unittest.main()

0 comments on commit 5e68837

Please sign in to comment.