Node.js: ServerRequest and ServerResponse compliance to Stream API.

ServerRequest now inherit stream Readable object.  ServerResponse
provides 'writable' property.

Thanks to Wu Jian Ping (@wujjpp).

This closes #274, closes #317 issues and closes #502 PR on GitHub.
This commit is contained in:
Max Romanov
2020-12-29 19:00:54 +03:00
parent 3abca42caf
commit d3d6864bdc
5 changed files with 94 additions and 89 deletions

View File

@@ -222,22 +222,6 @@ class TestNodeApplication(TestApplicationNode):
assert 'X-Header' not in headers, 'insensitive'
assert 'X-header' not in headers, 'insensitive 2'
def test_node_application_promise_handler(self, temp_dir):
self.load('promise_handler')
assert (
self.post(
headers={
'Host': 'localhost',
'Content-Type': 'text/html',
'Connection': 'close',
},
body='callback',
)['status']
== 200
), 'promise handler request'
assert waitforfiles(temp_dir + '/node/callback'), 'promise handler'
def test_node_application_promise_handler_write_after_end(self):
self.load('promise_handler')
@@ -270,35 +254,6 @@ class TestNodeApplication(TestApplicationNode):
), 'promise end request'
assert waitforfiles(temp_dir + '/node/callback'), 'promise end'
def test_node_application_promise_multiple_calls(self, temp_dir):
self.load('promise_handler')
self.post(
headers={
'Host': 'localhost',
'Content-Type': 'text/html',
'Connection': 'close',
},
body='callback1',
)
assert waitforfiles(
temp_dir + '/node/callback1'
), 'promise first call'
self.post(
headers={
'Host': 'localhost',
'Content-Type': 'text/html',
'Connection': 'close',
},
body='callback2',
)
assert waitforfiles(
temp_dir + '/node/callback2'
), 'promise second call'
@pytest.mark.skip('not yet')
def test_node_application_header_name_valid(self):
self.load('header_name_valid')