File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,28 @@ describe('PythonShell', function () {
94
94
done ( ) ;
95
95
} ) ;
96
96
} ) ;
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
+ } ) ;
97
119
} ) ;
98
120
context ( 'binary mode' , function ( ) {
99
121
it ( 'should write as-is' , function ( done ) {
You can’t perform that action at this time.
0 commit comments