TEST: Verify base64 return values after decoding.

This commit is contained in:
Scott Sanderson 2014-12-16 00:23:43 -05:00 committed by Min RK
parent fcc1bbecb3
commit e9b81b6c7a

View File

@ -288,8 +288,10 @@ class APITest(NotebookTestBase):
self.assertIn('content', model)
self.assertEqual(model['format'], 'base64')
self.assertEqual(model['type'], 'file')
b64_data = base64.encodestring(self._blob_for_name(name)).decode('ascii')
self.assertEqual(model['content'], b64_data)
self.assertEqual(
base64.decodestring(model['content']),
self._blob_for_name(name),
)
# Name that doesn't exist - should be a 404
with assert_http_error(404):