Index: /main/waeup.sirp/trunk/src/waeup/sirp/utils/tests/test_helpers.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/utils/tests/test_helpers.py	(revision 7079)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/utils/tests/test_helpers.py	(revision 7080)
@@ -27,4 +27,5 @@
 import unittest
 import doctest
+from cStringIO import StringIO
 from zope.security.testing import Principal, Participation
 from zope.security.management import newInteraction, endInteraction
@@ -219,4 +220,25 @@
         f2 = open(p2, 'wb').write('Ho!')
         assert helpers.cmp_files(open(p1, 'r'), open(p2, 'r')) is False
+
+class FileSizeTestCase(unittest.TestCase):
+
+    def setUp(self):
+        self.workdir = tempfile.mkdtemp()
+
+    def tearDown(self):
+        shutil.rmtree(self.workdir)
+
+    def test_real_file(self):
+        # we can get the size of real files
+        path = os.path.join(self.workdir, 'sample.txt')
+        open(path, 'wb').write('My content')
+        self.assertEqual(
+            int(helpers.file_size(open(path, 'rb'))), 10)
+        return
+
+    def test_stringio_file(self):
+        # we can get the size of file-like objects
+        self.assertEqual(
+            helpers.file_size(StringIO('my sample content')), 17)
 
 def test_suite():
@@ -230,4 +252,5 @@
         CurrentPrincipalTestCase,
         CmpFilesTestCase,
+        FileSizeTestCase,
         ]:
         suite.addTests(
