Skip to content

Commit 728cde3

Browse files
committed
Fix pep8 to make CI green.
Signed-off-by: George Melikov <[email protected]>
1 parent 6bcb1b5 commit 728cde3

File tree

1 file changed

+52
-26
lines changed

1 file changed

+52
-26
lines changed

loopster/tests/unit/services/test_softirq.py

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@ def _step(self):
4747

4848
class SoftIRQLoopStepMinorWatchdogErrorInTryTestCase(unittest.TestCase):
4949

50-
@mock.patch('loopster.services.softirq.SoftIrqService._send_wd_error_event')
51-
@mock.patch('loopster.services.softirq.SoftIrqService._send_exc_step_event')
52-
@mock.patch('loopster.services.softirq.SoftIrqService._send_step_event')
50+
@mock.patch('loopster.services.softirq.SoftIrqService'
51+
'._send_wd_error_event')
52+
@mock.patch('loopster.services.softirq.SoftIrqService'
53+
'._send_exc_step_event')
54+
@mock.patch('loopster.services.softirq.SoftIrqService'
55+
'._send_step_event')
5356
@mock.patch('loopster.watchdogs.base.WatchDogBase.__enter__')
5457
def test_error_only_enter(self, enter, send, err_send, wd_send):
5558
enter.side_effect = FAKE_WD_MINOR_EXCEPTION
@@ -60,9 +63,12 @@ def test_error_only_enter(self, enter, send, err_send, wd_send):
6063
err_send.assert_not_called()
6164
wd_send.assert_called_once()
6265

63-
@mock.patch('loopster.services.softirq.SoftIrqService._send_wd_error_event')
64-
@mock.patch('loopster.services.softirq.SoftIrqService._send_exc_step_event')
65-
@mock.patch('loopster.services.softirq.SoftIrqService._send_step_event')
66+
@mock.patch('loopster.services.softirq.SoftIrqService'
67+
'._send_wd_error_event')
68+
@mock.patch('loopster.services.softirq.SoftIrqService'
69+
'._send_exc_step_event')
70+
@mock.patch('loopster.services.softirq.SoftIrqService'
71+
'._send_step_event')
6672
@mock.patch('loopster.watchdogs.base.WatchDogBase.__exit__')
6773
def test_error_only_exit(self, exit, send, err_send, wd_send):
6874
exit.side_effect = FAKE_WD_MINOR_EXCEPTION
@@ -73,9 +79,12 @@ def test_error_only_exit(self, exit, send, err_send, wd_send):
7379
err_send.assert_not_called()
7480
wd_send.assert_called_once()
7581

76-
@mock.patch('loopster.services.softirq.SoftIrqService._send_wd_error_event')
77-
@mock.patch('loopster.services.softirq.SoftIrqService._send_exc_step_event')
78-
@mock.patch('loopster.services.softirq.SoftIrqService._send_step_event')
82+
@mock.patch('loopster.services.softirq.SoftIrqService'
83+
'._send_wd_error_event')
84+
@mock.patch('loopster.services.softirq.SoftIrqService'
85+
'._send_exc_step_event')
86+
@mock.patch('loopster.services.softirq.SoftIrqService'
87+
'._send_step_event')
7988
def test_error_only_step(self, send, err_send, wd_send):
8089
s = TestService()
8190
with mock.patch.object(s,
@@ -87,9 +96,12 @@ def test_error_only_step(self, send, err_send, wd_send):
8796
err_send.assert_called_once()
8897
wd_send.assert_not_called()
8998

90-
@mock.patch('loopster.services.softirq.SoftIrqService._send_wd_error_event')
91-
@mock.patch('loopster.services.softirq.SoftIrqService._send_exc_step_event')
92-
@mock.patch('loopster.services.softirq.SoftIrqService._send_step_event')
99+
@mock.patch('loopster.services.softirq.SoftIrqService'
100+
'._send_wd_error_event')
101+
@mock.patch('loopster.services.softirq.SoftIrqService'
102+
'._send_exc_step_event')
103+
@mock.patch('loopster.services.softirq.SoftIrqService'
104+
'._send_step_event')
93105
@mock.patch('loopster.watchdogs.base.WatchDogBase.__exit__')
94106
def test_error_exit_and_step(self, exit, send, err_send, wd_send):
95107
exit.side_effect = FAKE_WD_MINOR_EXCEPTION
@@ -103,9 +115,12 @@ def test_error_exit_and_step(self, exit, send, err_send, wd_send):
103115
err_send.assert_called_once()
104116
wd_send.assert_called_once()
105117

106-
@mock.patch('loopster.services.softirq.SoftIrqService._send_wd_error_event')
107-
@mock.patch('loopster.services.softirq.SoftIrqService._send_exc_step_event')
108-
@mock.patch('loopster.services.softirq.SoftIrqService._send_step_event')
118+
@mock.patch('loopster.services.softirq.SoftIrqService'
119+
'._send_wd_error_event')
120+
@mock.patch('loopster.services.softirq.SoftIrqService'
121+
'._send_exc_step_event')
122+
@mock.patch('loopster.services.softirq.SoftIrqService'
123+
'._send_step_event')
109124
@mock.patch('loopster.watchdogs.base.WatchDogBase.__enter__')
110125
def test_error_enter_and_step(self, enter, send, err_send, wd_send):
111126
enter.side_effect = FAKE_WD_MINOR_EXCEPTION
@@ -119,9 +134,12 @@ def test_error_enter_and_step(self, enter, send, err_send, wd_send):
119134
err_send.assert_not_called()
120135
wd_send.assert_called_once()
121136

122-
@mock.patch('loopster.services.softirq.SoftIrqService._send_wd_error_event')
123-
@mock.patch('loopster.services.softirq.SoftIrqService._send_exc_step_event')
124-
@mock.patch('loopster.services.softirq.SoftIrqService._send_step_event')
137+
@mock.patch('loopster.services.softirq.SoftIrqService'
138+
'._send_wd_error_event')
139+
@mock.patch('loopster.services.softirq.SoftIrqService'
140+
'._send_exc_step_event')
141+
@mock.patch('loopster.services.softirq.SoftIrqService'
142+
'._send_step_event')
125143
@mock.patch('loopster.watchdogs.base.WatchDogBase.__exit__')
126144
@mock.patch('loopster.watchdogs.base.WatchDogBase.__enter__')
127145
def test_error_all(self, enter, exit, send, err_send, wd_send):
@@ -137,8 +155,10 @@ def test_error_all(self, enter, exit, send, err_send, wd_send):
137155
err_send.assert_not_called()
138156
wd_send.assert_called_once()
139157

140-
@mock.patch('loopster.services.softirq.SoftIrqService._serve_fake')
141-
@mock.patch('loopster.services.softirq.SoftIrqService._serve_operational')
158+
@mock.patch('loopster.services.softirq.SoftIrqService'
159+
'._serve_fake')
160+
@mock.patch('loopster.services.softirq.SoftIrqService'
161+
'._serve_operational')
142162
def test_only_step_enabled(self, serve_operational, serve_fake):
143163
s = TestService()
144164

@@ -147,8 +167,10 @@ def test_only_step_enabled(self, serve_operational, serve_fake):
147167
serve_operational.assert_called_once()
148168
serve_fake.assert_not_called()
149169

150-
@mock.patch('loopster.services.softirq.SoftIrqService._serve_fake')
151-
@mock.patch('loopster.services.softirq.SoftIrqService._serve_operational')
170+
@mock.patch('loopster.services.softirq.SoftIrqService'
171+
'._serve_fake')
172+
@mock.patch('loopster.services.softirq.SoftIrqService'
173+
'._serve_operational')
152174
def test_only_step_not_enabled(self, serve_operational, serve_fake):
153175
s = TestService(operate=False)
154176

@@ -157,10 +179,14 @@ def test_only_step_not_enabled(self, serve_operational, serve_fake):
157179
serve_operational.assert_not_called()
158180
serve_fake.assert_called_once()
159181

160-
@mock.patch('loopster.services.softirq.SoftIrqService._send_wd_error_event')
161-
@mock.patch('loopster.services.softirq.SoftIrqService._send_exc_step_event')
162-
@mock.patch('loopster.services.softirq.SoftIrqService._send_step_event')
163-
@mock.patch('loopster.services.softirq.SoftIrqService._on_sighup')
182+
@mock.patch('loopster.services.softirq.SoftIrqService'
183+
'._send_wd_error_event')
184+
@mock.patch('loopster.services.softirq.SoftIrqService'
185+
'._send_exc_step_event')
186+
@mock.patch('loopster.services.softirq.SoftIrqService'
187+
'._send_step_event')
188+
@mock.patch('loopster.services.softirq.SoftIrqService'
189+
'._on_sighup')
164190
def test_loop_step_error_only_step_and_signum(self, on_sighup, send,
165191
err_send, wd_send):
166192
s = TestService(signum=multiprocessing.Value("i", 0))

0 commit comments

Comments
 (0)