[tests] fix bfss tests to match new uniquify implementation stable
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Wed, 14 Apr 2010 08:58:57 +0200
branchstable
changeset 5240 2af0427e8ead
parent 5231 40f53867e332
child 5242 0063d990ac5a
child 5245 385c2351153e
[tests] fix bfss tests to match new uniquify implementation
server/test/unittest_storage.py
--- a/server/test/unittest_storage.py	Tue Apr 13 19:22:46 2010 +0200
+++ b/server/test/unittest_storage.py	Wed Apr 14 08:58:57 2010 +0200
@@ -55,7 +55,7 @@
     def create_file(self, content='the-data'):
         req = self.request()
         return req.create_entity('File', data=Binary(content),
-                                 data_format=u'text/plain', data_name=u'foo')
+                                 data_format=u'text/plain', data_name=u'foo.pdf')
 
     def fspath(self, entity):
         fspath = self.execute('Any fspath(D) WHERE F eid %(f)s, F data D',
@@ -64,7 +64,8 @@
 
     def test_bfss_storage(self):
         f1 = self.create_file()
-        expected_filepath = osp.join(self.tempdir, '%s_data' % f1.eid)
+        expected_filepath = osp.join(self.tempdir, '%s_data_%s' %
+                                     (f1.eid, f1.data_name))
         self.failUnless(osp.isfile(expected_filepath))
         self.assertEquals(file(expected_filepath).read(), 'the-data')
         self.rollback()
@@ -85,7 +86,7 @@
 
     def test_bfss_sqlite_fspath(self):
         f1 = self.create_file()
-        expected_filepath = osp.join(self.tempdir, '%s_data' % f1.eid)
+        expected_filepath = osp.join(self.tempdir, '%s_data_%s' % (f1.eid, f1.data_name))
         self.assertEquals(self.fspath(f1), expected_filepath)
 
     def test_bfss_fs_importing_doesnt_touch_path(self):