From dcf1ddf7ba217274de46df64bb78e8dbcfa3ebfe Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Thu, 14 Jan 2016 15:02:49 +0100 Subject: [PATCH] added comments and todos --- file_helpers.py | 2 +- test/test_helper_unittest.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/file_helpers.py b/file_helpers.py index bfc8db3..9fd7cb1 100644 --- a/file_helpers.py +++ b/file_helpers.py @@ -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 """ diff --git a/test/test_helper_unittest.py b/test/test_helper_unittest.py index 0b0eeb6..6c0eb65 100644 --- a/test/test_helper_unittest.py +++ b/test/test_helper_unittest.py @@ -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)) -- 1.7.1