Formatting: Format all python code with black.
This CL is probably not what you're looking for, it's only
automated formatting. Ignore it with
`git blame --ignore-rev <revision>` for this commit.
BUG=b:233893248
TEST=CQ
Change-Id: I66591d7a738d241aed3290138c0f68065ab10a6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/3879174
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Alex Klein <saklein@chromium.org>
diff --git a/scripts/sysmon/mainlib_unittest.py b/scripts/sysmon/mainlib_unittest.py
index 6f2bdd9..bb5dc63 100644
--- a/scripts/sysmon/mainlib_unittest.py
+++ b/scripts/sysmon/mainlib_unittest.py
@@ -15,48 +15,48 @@
class TestTimedCallback(cros_test_lib.TestCase):
- """Tests for _TimedCallback."""
+ """Tests for _TimedCallback."""
- def setUp(self):
- patcher = mock.patch('time.time', autospec=True)
- self.time = patcher.start()
- self.addCleanup(patcher.stop)
+ def setUp(self):
+ patcher = mock.patch("time.time", autospec=True)
+ self.time = patcher.start()
+ self.addCleanup(patcher.stop)
- def test_initial_call_should_callback(self):
- """Test that initial call goes through."""
- cb = mock.Mock([])
+ def test_initial_call_should_callback(self):
+ """Test that initial call goes through."""
+ cb = mock.Mock([])
- self.time.return_value = 0
- obj = mainlib._TimedCallback(cb, 10)
+ self.time.return_value = 0
+ obj = mainlib._TimedCallback(cb, 10)
- obj()
- cb.assert_called_once()
+ obj()
+ cb.assert_called_once()
- def test_call_within_interval_should_not_callback(self):
- """Test that call too soon does not callback."""
- cb = mock.Mock([])
+ def test_call_within_interval_should_not_callback(self):
+ """Test that call too soon does not callback."""
+ cb = mock.Mock([])
- self.time.return_value = 0
- obj = mainlib._TimedCallback(cb, 10)
+ self.time.return_value = 0
+ obj = mainlib._TimedCallback(cb, 10)
- obj()
- cb.assert_called_once()
+ obj()
+ cb.assert_called_once()
- cb.reset_mock()
- obj()
- cb.assert_not_called()
+ cb.reset_mock()
+ obj()
+ cb.assert_not_called()
- def test_call_after_interval_should_callback(self):
- """Test that later call does callback."""
- cb = mock.Mock([])
+ def test_call_after_interval_should_callback(self):
+ """Test that later call does callback."""
+ cb = mock.Mock([])
- self.time.return_value = 0
- obj = mainlib._TimedCallback(cb, 10)
+ self.time.return_value = 0
+ obj = mainlib._TimedCallback(cb, 10)
- obj()
- cb.assert_called_once()
+ obj()
+ cb.assert_called_once()
- self.time.return_value = 10
- cb.reset_mock()
- obj()
- cb.assert_called_once()
+ self.time.return_value = 10
+ cb.reset_mock()
+ obj()
+ cb.assert_called_once()