File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1111import platform
1212
1313
14+ class XCppCompleteTests (jupyter_kernel_test .KernelTests ):
15+
16+ kernel_name = 'xcpp'
17+
18+ # language_info.name in a kernel_info_reply should match this
19+ language_name = 'C++'
20+
21+ # Code complete
22+ code_complete_presample_code = 'int foo = 12;'
23+ code_complete_sample = 'f'
24+
25+ def test_codecomplete (self ) -> None :
26+ if not self .code_complete_sample :
27+ raise SkipTest ("No code complete sample" )
28+ if self .code_complete_presample_code :
29+ self .flush_channels ()
30+ reply , output_msgs = self .execute_helper (code = self .code_complete_presample_code )
31+ self .assertEqual (reply ["content" ]["status" ], "ok" )
32+ self .flush_channels ()
33+ msg_id = self .kc .complete (self .code_complete_sample , len (self .code_complete_sample ))
34+ reply = self .get_non_kernel_info_reply (timeout = 1 )
35+ assert reply is not None
36+ self .assertEqual (reply ["msg_type" ], "complete_reply" )
37+ self .assertEqual (str (reply ["content" ]["matches" ]), "['float', 'foo']" )
38+ self .assertEqual (reply ["content" ]["status" ], "ok" )
39+
40+
1441class XCppTests (jupyter_kernel_test .KernelTests ):
1542
1643 kernel_name = 'xcpp'
You can’t perform that action at this time.
0 commit comments