Index: /main/waeup.kofa/trunk/src/waeup/kofa/tests/test_imagestorage.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/tests/test_imagestorage.py	(revision 9285)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/tests/test_imagestorage.py	(revision 9286)
@@ -35,12 +35,4 @@
     IFileStoreNameChooser, IExtFileStore, IFileStoreHandler,)
 
-class HelperFuncsTests(unittest.TestCase):
-
-    def setUp(self):
-        self.workdir = tempfile.mkdtemp()
-
-    def tearDown(self):
-        shutil.rmtree(self.workdir)
-
 class FileStoreNameChooserTests(FunctionalTestCase):
 
@@ -93,4 +85,5 @@
         verifyClass(IExtFileStore, ExtFileStore)
         verifyObject(IExtFileStore, obj)
+        self.root = obj.root # for cleanup
         return
 
@@ -104,4 +97,5 @@
 
     def test_create_instance(self):
+        # we can create file stores with or without a root dir set
         storage1 = ExtFileStore()
         storage2 = ExtFileStore(root=self.workdir)
@@ -227,4 +221,5 @@
         super(FunctionalExtFileStoreTests, self).setUp()
         self.workdir = tempfile.mkdtemp()
+        self.root = None
         self.samplefile = os.path.join(self.workdir, 'sample')
         self.otherfile = os.path.join(self.workdir, 'other')
@@ -251,4 +246,6 @@
         self.fd2.close()
         shutil.rmtree(self.workdir)
+        if self.root is not None and os.path.exists(self.root):
+            shutil.rmtree(self.root)
         return
 
@@ -325,12 +322,11 @@
         # if we register a file name chooser, we can also get a file
         # by context and attribute
-        fs = ExtFileStore(root=self.workdir)
         context = CustomContext()
         file_id1 = IFileStoreNameChooser(context).chooseName()
         file_id2 = IFileStoreNameChooser(context).chooseName(attr='img')
         file_id3 = IFileStoreNameChooser(context).chooseName(attr='doc')
-        fs = ExtFileStore(root=self.workdir)
-        # create three files for a single context, each which
-        # different content
+        # create three files for a single context, each with different
+        # content
+        fs = ExtFileStore(root=self.workdir)
         fs.createFile(file_id1, StringIO('my sample 1'))
         fs.createFile(file_id2, StringIO('my sample 2'))
