added comments and todos
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Thu, 14 Jan 2016 14:02:49 +0000 (15:02 +0100)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Thu, 14 Jan 2016 14:02:49 +0000 (15:02 +0100)
file_helpers.py
test/test_helper_unittest.py

index bfc8db3..9fd7cb1 100644 (file)
@@ -6,7 +6,7 @@ Featuring::
   will print current working dir, then other_dir, then first dir again
 * a wrapper around "df" to determine size and usage of file systems
 
-.. todo:: create unittest
+.. todo:: change get_filesystem_fill_states to not fork
 
 .. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
 """
index 0b0eeb6..6c0eb65 100644 (file)
@@ -24,7 +24,7 @@ import test_helpers
 class TestHelperTester(unittest.TestCase):
 
     def assertNoWarn(self, func, *args, **kwargs):
-        """ check that calling function raises no warning 
+        """ check that calling function raises no warning
 
         use warnings.catch_warnings instead of self.assertWarn
         for compatibility with python 2
@@ -40,7 +40,7 @@ class TestHelperTester(unittest.TestCase):
 
 
     def assertWarn(self, warn_type, message, func, *args, **kwargs):
-        """ check that calling function raises no warning 
+        """ check that calling function raises no warning
 
         use warnings.catch_warnings instead of self.assertWarn
         for compatibility with python 2
@@ -240,10 +240,16 @@ class TestHelperTester(unittest.TestCase):
 
 
     def nonsense_function(self, sleep_time):
-        """ function to run while checking disc fill state; just sleeps """
+        """ function to run while checking disc fill state; just sleeps
+
+        to make this test quicker could try to use profiling to count calls to
+        disc checker function and stop this after 2 or so
+        """
         sleep(sleep_time)
 
     def threading_profile_func(self, *args, **kwargs):
+        """ todo: set this as profiling function for checker thread, count
+        calls to disc checker function, trigger event or so """
         print('profiling with args {0} and kwargs {1}'
               .format([arg for arg in args if len(args) < 20], kwargs))