Show More
@@ -10,6 +10,7 b' pjoin = os.path.join' | |||||
10 |
|
10 | |||
11 | import requests |
|
11 | import requests | |
12 |
|
12 | |||
|
13 | from IPython.kernel.kernelspec import NATIVE_KERNEL_NAME | |||
13 | from IPython.html.utils import url_path_join |
|
14 | from IPython.html.utils import url_path_join | |
14 | from IPython.html.tests.launchnotebook import NotebookTestBase, assert_http_error |
|
15 | from IPython.html.tests.launchnotebook import NotebookTestBase, assert_http_error | |
15 |
|
16 | |||
@@ -70,12 +71,16 b' class APITest(NotebookTestBase):' | |||||
70 | assert isinstance(specs, list) |
|
71 | assert isinstance(specs, list) | |
71 |
|
72 | |||
72 | # 2: the sample kernelspec created in setUp, and the native Python kernel |
|
73 | # 2: the sample kernelspec created in setUp, and the native Python kernel | |
73 | self.assertEqual(len(specs), 2) |
|
74 | self.assertGreaterEqual(len(specs), 2) | |
74 |
|
75 | |||
75 | def is_sample_kernelspec(s): |
|
76 | def is_sample_kernelspec(s): | |
76 | return s['name'] == 'sample' and s['display_name'] == 'Test kernel' |
|
77 | return s['name'] == 'sample' and s['display_name'] == 'Test kernel' | |
77 |
|
78 | |||
|
79 | def is_default_kernelspec(s): | |||
|
80 | return s['name'] == NATIVE_KERNEL_NAME and s['display_name'].startswith("IPython") | |||
|
81 | ||||
78 | assert any(is_sample_kernelspec(s) for s in specs), specs |
|
82 | assert any(is_sample_kernelspec(s) for s in specs), specs | |
|
83 | assert any(is_default_kernelspec(s) for s in specs), specs | |||
79 |
|
84 | |||
80 | def test_get_kernelspec(self): |
|
85 | def test_get_kernelspec(self): | |
81 | spec = self.ks_api.kernel_spec_info('Sample').json() # Case insensitive |
|
86 | spec = self.ks_api.kernel_spec_info('Sample').json() # Case insensitive |
General Comments 0
You need to be logged in to leave comments.
Login now