##// END OF EJS Templates
unicode normalization in test_notebooks_api
MinRK -
Show More
@@ -1,8 +1,11 b''
1 # coding: utf-8
1 """Test the notebooks webservice API."""
2 """Test the notebooks webservice API."""
2
3
3 import io
4 import io
4 import os
5 import os
5 import shutil
6 import shutil
7 from unicodedata import normalize
8
6 from zmq.utils import jsonapi
9 from zmq.utils import jsonapi
7
10
8 pjoin = os.path.join
11 pjoin = os.path.join
@@ -111,9 +114,10 b' class APITest(NotebookTestBase):'
111
114
112 nbs = self.nb_api.list('foo').json()
115 nbs = self.nb_api.list('foo').json()
113 self.assertEqual(len(nbs), 4)
116 self.assertEqual(len(nbs), 4)
114 nbnames = set(n['name'] for n in nbs)
117 nbnames = { normalize('NFC', n['name']) for n in nbs }
115 self.assertEqual(nbnames, {'a.ipynb', 'b.ipynb',
118 expected = [ u'a.ipynb', u'b.ipynb', u'name with spaces.ipynb', u'unicodé.ipynb']
116 'name with spaces.ipynb', u'unicodé.ipynb'})
119 expected = { normalize('NFC', name) for name in expected }
120 self.assertEqual(nbnames, expected)
117
121
118 def assert_404(self, name, path):
122 def assert_404(self, name, path):
119 try:
123 try:
General Comments 0
You need to be logged in to leave comments. Login now