7 from autotest_lib
.client
.common_lib
.test_utils
import mock
8 from autotest_lib
.client
.common_lib
.test_utils
import unittest
9 from autotest_lib
.scheduler
import gc_stats
12 class TestGcStats(unittest
.TestCase
):
14 self
.god
= mock
.mock_god()
21 def test_log_garbage_collector_stats(self
):
22 # Call this for code coverage.
23 # Prevent log spam from this test but do test that the log
24 # message formats correctly.
25 def _mock_logging_func(message
, *args
):
28 self
.god
.stub_with(logging
, 'debug', _mock_logging_func
)
29 self
.god
.stub_with(logging
, 'info', _mock_logging_func
)
30 gc_stats
._log
_garbage
_collector
_stats
()
31 # Add a new dict, exercise the delta counting & printing code.
33 gc_stats
._log
_garbage
_collector
_stats
(1)
36 if __name__
== '__main__':