Skip to content

Commit 1aab1af

Browse files
committed
start writing conversation test
1 parent d0937de commit 1aab1af

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/test-python-shell.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,28 @@ describe('PythonShell', function () {
9494
done();
9595
});
9696
});
97+
it.only('holds a conversation', function (done) {
98+
var pyshell = new PythonShell('conversation.py', {
99+
mode: 'json'
100+
});
101+
var output = '';
102+
pyshell.stdout.on('data', function (data) {
103+
output += ''+data;
104+
});
105+
pyshell
106+
.send({ a: 'b' })
107+
.send(null)
108+
.send([1, 2, 3])
109+
.end(function (err) {
110+
if (err) {
111+
return done(err);
112+
}
113+
outputs = output.split('\n');
114+
output[0].should.be.exactly();
115+
output.should.be.exactly('{"a": "b"}\nnull\n[1, 2, 3]\n');
116+
done();
117+
});
118+
});
97119
});
98120
context('binary mode', function() {
99121
it('should write as-is', function (done) {

0 commit comments

Comments
 (0)