Skip to content

Commit

Permalink
aio-libs#263 pyflakes
Browse files Browse the repository at this point in the history
  • Loading branch information
tumb1er committed Feb 2, 2015
1 parent eaf724c commit 9e17320
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion tests/test_web_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def go():
self.loop.run_until_complete(
asyncio.wait_for(go(), timeout=0.1, loop=self.loop))


def test_post_json(self):

dct = {'key': 'текст'}
Expand Down
12 changes: 8 additions & 4 deletions tests/test_web_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,20 @@ def test_call_POST_for_100_continue(self):
body = b"123"
req = self.make_request(
'POST', '/',
headers=CIMultiDict({"EXPECT": "100-Continue", 'CONTENT-TYPE': ''}))
headers=CIMultiDict({"EXPECT": "100-Continue",
'CONTENT-TYPE': ''}))
with mock.patch.object(req, "read", side_effect=StopIteration(body)):
ret = self.loop.run_until_complete(req.post())
self.assertEqual(ret, body)
req.transport.write.assert_called_with(b'HTTP/1.1 100 Continue\r\n\r\n')
req.transport.write.assert_called_with(
b'HTTP/1.1 100 Continue\r\n\r\n')

def test_call_POST_for_100_continue_HTTP10(self):
body = b"123"
req = self.make_request(
'POST', '/',
headers=CIMultiDict({"EXPECT": "100-Continue", 'CONTENT-TYPE': ''}),
headers=CIMultiDict({"EXPECT": "100-Continue",
'CONTENT-TYPE': ''}),
version=HttpVersion(1, 0))

with mock.patch.object(req, "read", side_effect=StopIteration(body)):
Expand All @@ -142,7 +145,8 @@ def test_call_POST_for_other_expect(self):
body = b"123"
req = self.make_request(
'POST', '/',
headers=CIMultiDict({"EXPECT": "Other-thing", 'CONTENT-TYPE': ''}))
headers=CIMultiDict({"EXPECT": "Other-thing",
'CONTENT-TYPE': ''}))
with mock.patch.object(req, "read", side_effect=StopIteration(body)):
ret = self.loop.run_until_complete(req.post())
self.assertEqual(ret, body)
Expand Down

0 comments on commit 9e17320

Please sign in to comment.