Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 332be1b

Browse files
committed
Plugging retry tests
1 parent 2db75f9 commit 332be1b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/integration/test_client_server.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ def test_tcurl(mock_server):
9797
'--raw',
9898
])
9999

100-
assert response.headers == endpoint
101-
assert response.body == "hello"
100+
assert response.headers == endpoint.encode('utf8')
101+
assert response.body == "hello".encode('utf8')
102102

103103

104104
@pytest.mark.gen_test

tests/integration/test_retry.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ def after_receive_error(self, request, error):
131131

132132

133133
@pytest.mark.gen_test
134-
@mock.patch('tchannel.tornado.Request.should_retry_on_error')
135-
def test_retry_on_error_success(mock_should_retry_on_error):
134+
def test_retry_on_error_success():
135+
mock_should_retry_on_error = mock.patch('tchannel.tornado.Request.should_retry_on_error')
136136
mock_should_retry_on_error.return_value = True
137137

138138
endpoint = 'tchannelretrytest'
@@ -158,8 +158,8 @@ def test_retry_on_error_success(mock_should_retry_on_error):
158158

159159
header = yield response.get_header()
160160
body = yield response.get_body()
161-
assert body == "success"
162-
assert header == ""
161+
assert body == b"success"
162+
assert header == b""
163163

164164
assert hook.received_response == 1
165165
assert hook.received_error == 2

0 commit comments

Comments
 (0)