コード例 #1
0
 def test_output(self):
     response = Response(200, body='Something here')
     response.headers.add('Content-Type', 'text/html')
     string_output = "HTTP/1.1 200 OK\r\nContent-Length: 14\r\nContent-Type: text/html\r\n\r\nSomething here"
     raw_output = b'HTTP/1.1 200 OK\r\nContent-Length: 14\r\nContent-Type: text/html\r\n\r\nSomething here'
     assert str(response) == string_output
     assert response.raw() == raw_output
コード例 #2
0
ファイル: test_messages.py プロジェクト: watsonpy/watson-http
 def test_output(self):
     response = Response(200, body='Something here')
     response.headers.add('Content-Type', 'text/html')
     string_output = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\nSomething here"
     raw_output = b'HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\nSomething here'
     assert str(response) == string_output
     assert response.raw() == raw_output