From 8285d61c5bdc4e49af7cc861d9000ffc09720d9f 2014-12-17 19:38:45 From: Scott Sanderson Date: 2014-12-17 19:38:45 Subject: [PATCH] TEST: Verify base64 return values after decoding. --- diff --git a/IPython/html/services/contents/tests/test_contents_api.py b/IPython/html/services/contents/tests/test_contents_api.py index c9d4c79..36e849a 100644 --- a/IPython/html/services/contents/tests/test_contents_api.py +++ b/IPython/html/services/contents/tests/test_contents_api.py @@ -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):