Show More
@@ -99,17 +99,20 b' class APITest(NotebookTestBase):' | |||||
99 | self.assertGreaterEqual(len(specs), 2) |
|
99 | self.assertGreaterEqual(len(specs), 2) | |
100 |
|
100 | |||
101 | def is_sample_kernelspec(s): |
|
101 | def is_sample_kernelspec(s): | |
102 | return s['name'] == 'sample' and s['display_name'] == 'Test kernel' |
|
102 | return s['name'] == 'sample' and s['spec']['display_name'] == 'Test kernel' | |
103 |
|
103 | |||
104 | def is_default_kernelspec(s): |
|
104 | def is_default_kernelspec(s): | |
105 | return s['name'] == NATIVE_KERNEL_NAME and s['display_name'].startswith("IPython") |
|
105 | return s['name'] == NATIVE_KERNEL_NAME and s['spec']['display_name'].startswith("IPython") | |
106 |
|
106 | |||
107 | assert any(is_sample_kernelspec(s) for s in specs.values()), specs |
|
107 | assert any(is_sample_kernelspec(s) for s in specs.values()), specs | |
108 | assert any(is_default_kernelspec(s) for s in specs.values()), specs |
|
108 | assert any(is_default_kernelspec(s) for s in specs.values()), specs | |
109 |
|
109 | |||
110 | def test_get_kernelspec(self): |
|
110 | def test_get_kernelspec(self): | |
111 |
|
|
111 | model = self.ks_api.kernel_spec_info('Sample').json() # Case insensitive | |
112 |
self.assertEqual( |
|
112 | self.assertEqual(model['name'].lower(), 'sample') | |
|
113 | self.assertIsInstance(model['spec'], dict) | |||
|
114 | self.assertEqual(model['spec']['display_name'], 'Test kernel') | |||
|
115 | self.assertIsInstance(model['resources'], dict) | |||
113 |
|
116 | |||
114 | def test_get_nonexistant_kernelspec(self): |
|
117 | def test_get_nonexistant_kernelspec(self): | |
115 | with assert_http_error(404): |
|
118 | with assert_http_error(404): |
General Comments 0
You need to be logged in to leave comments.
Login now