def test_connection(self): connection = Connection( ('127.0.0.1', self.get_http_port()), 'localhost') yield From(connection.connect()) yield From(connection.write(b'GET / HTTP/1.0\r\n\r\n')) data = yield From(connection.read()) self.assertEqual(b'hello world!', data[-12:]) self.assertTrue(connection.closed())
def test_connection(self): connection = Connection(('127.0.0.1', self.get_http_port()), 'localhost') yield From(connection.connect()) yield From(connection.write(b'GET / HTTP/1.0\r\n\r\n')) data = yield From(connection.read()) self.assertEqual(b'hello world!', data[-12:]) self.assertTrue(connection.closed())