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