Show More
@@ -198,16 +198,20 class APITest(NotebookTestBase): | |||
|
198 | 198 | nb = to_notebook_json(nbcontent) |
|
199 | 199 | ws = new_worksheet() |
|
200 | 200 | nb.worksheets = [ws] |
|
201 | ws.cells.append(new_heading_cell('Created by test')) | |
|
201 | ws.cells.append(new_heading_cell(u'Created by test ³')) | |
|
202 | 202 | |
|
203 | 203 | nbmodel= {'name': 'a.ipynb', 'path':'foo', 'content': nb} |
|
204 | 204 | resp = self.nb_api.save('a.ipynb', path='foo', body=jsonapi.dumps(nbmodel)) |
|
205 | 205 | |
|
206 | 206 | nbfile = pjoin(self.notebook_dir.name, 'foo', 'a.ipynb') |
|
207 | with open(nbfile, 'r') as f: | |
|
207 | with io.open(nbfile, 'r', encoding='utf-8') as f: | |
|
208 | 208 | newnb = read(f, format='ipynb') |
|
209 | 209 | self.assertEqual(newnb.worksheets[0].cells[0].source, |
|
210 | 'Created by test') | |
|
210 | u'Created by test ³') | |
|
211 | nbcontent = self.nb_api.read('a.ipynb', 'foo').json()['content'] | |
|
212 | newnb = to_notebook_json(nbcontent) | |
|
213 | self.assertEqual(newnb.worksheets[0].cells[0].source, | |
|
214 | u'Created by test ³') | |
|
211 | 215 | |
|
212 | 216 | # Save and rename |
|
213 | 217 | nbmodel= {'name': 'a2.ipynb', 'path':'foo/bar', 'content': nb} |
General Comments 0
You need to be logged in to leave comments.
Login now