Changeset 9283 for main/waeup.kofa/trunk/src/waeup/kofa/tests
- Timestamp:
- 3 Oct 2012, 21:36:14 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_imagestorage.py
r7811 r9283 274 274 def test_default_handler_create_file(self): 275 275 # we can use the default handler to store files 276 fs = ExtFileStore( )276 fs = ExtFileStore(root=self.workdir) 277 277 result = fs.createFile('sample.txt', StringIO('sample text')) 278 278 self.assertEqual(result.data, 'sample.txt') … … 282 282 def test_default_handler_get_file(self): 283 283 # we can get files stored by the default handler 284 fs = ExtFileStore( )284 fs = ExtFileStore(root=self.workdir) 285 285 fs.createFile('sample.txt', StringIO('sample text')) 286 286 result1 = fs.getFile('sample.txt') … … 292 292 def test_customized_handler_create_file(self): 293 293 # we can use registered filename handlers 294 fs = ExtFileStore( )294 fs = ExtFileStore(root=self.workdir) 295 295 result = fs.createFile( 296 296 '__MYMARKER__sample.txt', StringIO('sample text')) … … 302 302 # when we create a file of img type, the filename ext is taken 303 303 # from input file. 304 fs = ExtFileStore( )304 fs = ExtFileStore(root=self.workdir) 305 305 result = fs.createFile( 306 306 '__MYMARKER__sample_img.png', StringIO('sample text')) … … 312 312 # we consider registered filename handlers when asking for 313 313 # stored files. 314 fs = ExtFileStore( )314 fs = ExtFileStore(root=self.workdir) 315 315 fs.createFile('__MYMARKER__sample.txt', StringIO('sample text')) 316 316 result1 = fs.getFile('__MYMARKER__sample.txt') … … 325 325 # if we register a file name chooser, we can also get a file 326 326 # by context and attribute 327 fs = ExtFileStore( )327 fs = ExtFileStore(root=self.workdir) 328 328 context = CustomContext() 329 329 file_id1 = IFileStoreNameChooser(context).chooseName() 330 330 file_id2 = IFileStoreNameChooser(context).chooseName(attr='img') 331 331 file_id3 = IFileStoreNameChooser(context).chooseName(attr='doc') 332 fs = ExtFileStore( )332 fs = ExtFileStore(root=self.workdir) 333 333 # create three files for a single context, each which 334 334 # different content … … 365 365 def test_delete_file(self): 366 366 # we can remove stored files from storage 367 fs = ExtFileStore( )367 fs = ExtFileStore(root=self.workdir) 368 368 # First, we store a file in file store 369 369 fs.createFile('sample.txt', StringIO('sample text')) … … 380 380 # if we register a file name chooser, we can also delete a file 381 381 # by context and attribute 382 fs = ExtFileStore( )382 fs = ExtFileStore(root=self.workdir) 383 383 context = CustomContext() 384 384 file_id1 = IFileStoreNameChooser(context).chooseName() 385 385 file_id2 = IFileStoreNameChooser(context).chooseName(attr='img') 386 386 file_id3 = IFileStoreNameChooser(context).chooseName(attr='doc') 387 fs = ExtFileStore( )387 fs = ExtFileStore(root=self.workdir) 388 388 # create three files for a single context, each which 389 389 # different content
Note: See TracChangeset for help on using the changeset viewer.