Tests: test_node_application_write_before_writeHead reworked.
Added res.end() call in application and response status check. Also, renamed to test_node_application_write_before_write_head.
This commit is contained in:
@@ -3,4 +3,5 @@
|
||||
require('unit-http').createServer(function (req, res) {
|
||||
res.write('blah');
|
||||
res.writeHead(200, {'Content-Type': 'text/plain'});
|
||||
res.end();
|
||||
}).listen(7080);
|
||||
|
||||
@@ -120,10 +120,10 @@ class TestUnitNodeApplication(unit.TestUnitApplicationNode):
|
||||
self.assertTrue(self.waitforfiles(self.testdir + '/node/callback'),
|
||||
'write callback')
|
||||
|
||||
def test_node_application_write_before_writeHead(self):
|
||||
def test_node_application_write_before_write_head(self):
|
||||
self.load('write_before_write_head')
|
||||
|
||||
self.get()
|
||||
self.assertEqual(self.get()['status'], 200, 'write before writeHead')
|
||||
|
||||
def test_node_application_double_end(self):
|
||||
self.load('double_end')
|
||||
|
||||
Reference in New Issue
Block a user