11use amalthea:: wire:: jupyter_message:: Message ;
2- use amalthea:: wire:: jupyter_message:: Status ;
32use amalthea:: wire:: kernel_info_request:: KernelInfoRequest ;
43use ark:: fixtures:: DummyArkFrontend ;
54use stdext:: assert_match;
@@ -28,12 +27,13 @@ fn test_execute_request() {
2827 frontend. send_execute_request ( "42" ) ;
2928 frontend. recv_iopub_busy ( ) ;
3029
31- assert_eq ! ( frontend. recv_iopub_execute_input( ) . code, "42" ) ;
30+ let input = frontend. recv_iopub_execute_input ( ) ;
31+ assert_eq ! ( input. code, "42" ) ;
3232 assert_eq ! ( frontend. recv_iopub_execute_result( ) , "[1] 42" ) ;
3333
3434 frontend. recv_iopub_idle ( ) ;
3535
36- assert_eq ! ( frontend. recv_shell_execute_reply( ) , Status :: Ok ) ;
36+ assert_eq ! ( frontend. recv_shell_execute_reply( ) , input . execution_count )
3737}
3838
3939#[ test]
@@ -43,10 +43,14 @@ fn test_execute_request_error() {
4343 frontend. send_execute_request ( "stop('foobar')" ) ;
4444 frontend. recv_iopub_busy ( ) ;
4545
46- assert_eq ! ( frontend. recv_iopub_execute_input( ) . code, "stop('foobar')" ) ;
46+ let input = frontend. recv_iopub_execute_input ( ) ;
47+ assert_eq ! ( input. code, "stop('foobar')" ) ;
4748 assert ! ( frontend. recv_iopub_execute_error( ) . contains( "foobar" ) ) ;
4849
4950 frontend. recv_iopub_idle ( ) ;
5051
51- assert_eq ! ( frontend. recv_shell_execute_reply_exception( ) , Status :: Error ) ;
52+ assert_eq ! (
53+ frontend. recv_shell_execute_reply_exception( ) ,
54+ input. execution_count
55+ ) ;
5256}
0 commit comments