[server] make `test_bfss_fs_importing_transparency` less verbose on failure
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 27 Nov 2012 12:36:33 +0100
changeset 8622 db988713459d
parent 8621 038d67f42061
child 8623 9f7481a05383
[server] make `test_bfss_fs_importing_transparency` less verbose on failure Dumping the whole content of a file on failure is a bit annoying. We only print the bad version here (it's usually the file path).
server/test/unittest_storage.py
--- a/server/test/unittest_storage.py	Fri Nov 23 17:12:58 2012 +0100
+++ b/server/test/unittest_storage.py	Tue Nov 27 12:36:33 2012 +0100
@@ -196,8 +196,11 @@
         filepath = osp.abspath(__file__)
         f1 = self.session.create_entity('File', data=Binary(filepath),
                                         data_format=u'text/plain', data_name=u'foo')
-        self.assertEqual(f1.data.getvalue(), file(filepath).read(),
-                          'files content differ')
+        cw_value = f1.data.getvalue()
+        fs_value = file(filepath).read()
+        if cw_value != fs_value:
+            self.fail('cw value %r is different from file content' % cw_value)
+
 
     @tag('update')
     def test_bfss_update_with_existing_data(self):