forked from jupyter-xeus/xeus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_kernel.py
36 lines (25 loc) · 951 Bytes
/
test_kernel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import unittest
import jupyter_kernel_test
class XeusKernelTests(jupyter_kernel_test.KernelTests):
kernel_name = "test_kernel"
language_name = "cpp"
code_hello_world = "hello, world"
code_page_something = "?"
code_execute_result = [
{'code': '6*7', 'result': '6*7'},
{'code': 'test', 'result': 'test'}
]
completion_samples = [
{'text': 'a.', 'matches': ['a.test1', 'a.test2']}
]
complete_code_samples = ["complete"]
incomplete_code_samples = ["incomplete"]
invalid_code_samples = ["invalid"]
code_inspect_sample = "invalid"
def test_xeus_stderr(self):
reply, output_msgs = self.execute_helper(code='error')
self.assertEqual(output_msgs[0]['msg_type'], 'stream')
self.assertEqual(output_msgs[0]['content']['name'], 'stderr')
self.assertEqual(output_msgs[0]['content']['text'], 'error')
if __name__ == '__main__':
unittest.main()