Show More
@@ -64,13 +64,13 b' class KernelAPITest(NotebookTestBase):' | |||||
64 | # POST request |
|
64 | # POST request | |
65 | r = self.kern_api.start() |
|
65 | r = self.kern_api.start() | |
66 | kern1 = r.json() |
|
66 | kern1 = r.json() | |
67 |
self.assertEqual |
|
67 | self.assertEqual(r.headers['location'], '/api/kernels/' + kern1['id']) | |
68 |
self.assertEqual |
|
68 | self.assertEqual(r.status_code, 201) | |
69 | self.assertIsInstance(kern1, dict) |
|
69 | self.assertIsInstance(kern1, dict) | |
70 |
|
70 | |||
71 | # GET request |
|
71 | # GET request | |
72 | r = self.kern_api.list() |
|
72 | r = self.kern_api.list() | |
73 |
self.assertEqual |
|
73 | self.assertEqual(r.status_code, 200) | |
74 | assert isinstance(r.json(), list) |
|
74 | assert isinstance(r.json(), list) | |
75 | self.assertEqual(r.json()[0]['id'], kern1['id']) |
|
75 | self.assertEqual(r.json()[0]['id'], kern1['id']) | |
76 |
|
76 | |||
@@ -80,9 +80,9 b' class KernelAPITest(NotebookTestBase):' | |||||
80 | assert isinstance(kern2, dict) |
|
80 | assert isinstance(kern2, dict) | |
81 | r = self.kern_api.list() |
|
81 | r = self.kern_api.list() | |
82 | kernels = r.json() |
|
82 | kernels = r.json() | |
83 |
self.assertEqual |
|
83 | self.assertEqual(r.status_code, 200) | |
84 | assert isinstance(kernels, list) |
|
84 | assert isinstance(kernels, list) | |
85 |
self.assertEqual |
|
85 | self.assertEqual(len(kernels), 2) | |
86 |
|
86 | |||
87 | # Interrupt a kernel |
|
87 | # Interrupt a kernel | |
88 | r = self.kern_api.interrupt(kern2['id']) |
|
88 | r = self.kern_api.interrupt(kern2['id']) | |
@@ -100,7 +100,7 b' class KernelAPITest(NotebookTestBase):' | |||||
100 | kid = self.kern_api.start().json()['id'] |
|
100 | kid = self.kern_api.start().json()['id'] | |
101 | r = self.kern_api.get(kid) |
|
101 | r = self.kern_api.get(kid) | |
102 | kern1 = r.json() |
|
102 | kern1 = r.json() | |
103 |
self.assertEqual |
|
103 | self.assertEqual(r.status_code, 200) | |
104 | assert isinstance(kern1, dict) |
|
104 | assert isinstance(kern1, dict) | |
105 | self.assertIn('id', kern1) |
|
105 | self.assertIn('id', kern1) | |
106 | self.assertIn('ws_url', kern1) |
|
106 | self.assertIn('ws_url', kern1) |
General Comments 0
You need to be logged in to leave comments.
Login now