Ignore:
Timestamp:
3 Oct 2012, 21:36:14 (12 years ago)
Author:
Henrik Bettermann
Message:

Remove temporary dirs in tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/tests/test_imagestorage.py

    r7811 r9283  
    274274    def test_default_handler_create_file(self):
    275275        # we can use the default handler to store files
    276         fs = ExtFileStore()
     276        fs = ExtFileStore(root=self.workdir)
    277277        result = fs.createFile('sample.txt', StringIO('sample text'))
    278278        self.assertEqual(result.data, 'sample.txt')
     
    282282    def test_default_handler_get_file(self):
    283283        # we can get files stored by the default handler
    284         fs = ExtFileStore()
     284        fs = ExtFileStore(root=self.workdir)
    285285        fs.createFile('sample.txt', StringIO('sample text'))
    286286        result1 = fs.getFile('sample.txt')
     
    292292    def test_customized_handler_create_file(self):
    293293        # we can use registered filename handlers
    294         fs = ExtFileStore()
     294        fs = ExtFileStore(root=self.workdir)
    295295        result = fs.createFile(
    296296            '__MYMARKER__sample.txt', StringIO('sample text'))
     
    302302        # when we create a file of img type, the filename ext is taken
    303303        # from input file.
    304         fs = ExtFileStore()
     304        fs = ExtFileStore(root=self.workdir)
    305305        result = fs.createFile(
    306306            '__MYMARKER__sample_img.png', StringIO('sample text'))
     
    312312        # we consider registered filename handlers when asking for
    313313        # stored files.
    314         fs = ExtFileStore()
     314        fs = ExtFileStore(root=self.workdir)
    315315        fs.createFile('__MYMARKER__sample.txt', StringIO('sample text'))
    316316        result1 = fs.getFile('__MYMARKER__sample.txt')
     
    325325        # if we register a file name chooser, we can also get a file
    326326        # by context and attribute
    327         fs = ExtFileStore()
     327        fs = ExtFileStore(root=self.workdir)
    328328        context = CustomContext()
    329329        file_id1 = IFileStoreNameChooser(context).chooseName()
    330330        file_id2 = IFileStoreNameChooser(context).chooseName(attr='img')
    331331        file_id3 = IFileStoreNameChooser(context).chooseName(attr='doc')
    332         fs = ExtFileStore()
     332        fs = ExtFileStore(root=self.workdir)
    333333        # create three files for a single context, each which
    334334        # different content
     
    365365    def test_delete_file(self):
    366366        # we can remove stored files from storage
    367         fs = ExtFileStore()
     367        fs = ExtFileStore(root=self.workdir)
    368368        # First, we store a file in file store
    369369        fs.createFile('sample.txt', StringIO('sample text'))
     
    380380        # if we register a file name chooser, we can also delete a file
    381381        # by context and attribute
    382         fs = ExtFileStore()
     382        fs = ExtFileStore(root=self.workdir)
    383383        context = CustomContext()
    384384        file_id1 = IFileStoreNameChooser(context).chooseName()
    385385        file_id2 = IFileStoreNameChooser(context).chooseName(attr='img')
    386386        file_id3 = IFileStoreNameChooser(context).chooseName(attr='doc')
    387         fs = ExtFileStore()
     387        fs = ExtFileStore(root=self.workdir)
    388388        # create three files for a single context, each which
    389389        # different content
Note: See TracChangeset for help on using the changeset viewer.