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
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