@@ -135,14 +135,14 @@ def test_runforever_eager_error_on_request_some(self):
135135 prog .runforever (test = True )
136136 lines = prog .stderr .getvalue ().split ('\n ' )
137137 #self.assertEqual(len(lines), 7)
138- self .assertIn ("Restarting selected processes ['foo', 'bar', "
139- "'baz_01', 'notexisting']" , lines [0 ])
140- self .assertIn ('foo is in RUNNING state, restarting' , lines [1 ])
141- self .assertIn ('foo restarted' , lines [2 ])
142- self .assertIn ('bar not in RUNNING state, NOT restarting' , lines [3 ])
143- self .assertIn ('baz:baz_01 not in RUNNING state, NOT restarting' ,
138+ self .assertTrue ("Restarting selected processes ['foo', 'bar', "
139+ "'baz_01', 'notexisting']" in lines [0 ])
140+ self .assertTrue ('foo is in RUNNING state, restarting' in lines [1 ])
141+ self .assertTrue ('foo restarted' in lines [2 ])
142+ self .assertTrue ('bar not in RUNNING state, NOT restarting' in lines [3 ])
143+ self .assertTrue ('baz:baz_01 not in RUNNING state, NOT restarting' in
144144 lines [4 ])
145- self .assertIn ("Programs not restarted because "
145+ self .assertTrue ("Programs not restarted because "
146146 "they did not exist: ['notexisting']" , lines [5 ])
147147 mailed = prog .mailed .split ('\n ' )
148148 self .assertEqual (len (mailed ), 12 )
@@ -159,11 +159,11 @@ def test_runforever_eager_error_on_request_any(self):
159159 prog .runforever (test = True )
160160 lines = prog .stderr .getvalue ().split ('\n ' )
161161 #self.assertEqual(len(lines), 6)
162- self .assertIn ('Restarting all running processes' , lines [0 ])
163- self .assertIn ('foo is in RUNNING state, restarting' , lines [1 ])
164- self .assertIn ('foo restarted' , lines [2 ])
165- self .assertIn ('bar not in RUNNING state, NOT restarting' , lines [3 ])
166- self .assertIn ('baz:baz_01 not in RUNNING state, NOT restarting' ,
162+ self .assertTrue ('Restarting all running processes' in lines [0 ])
163+ self .assertTrue ('foo is in RUNNING state, restarting' in lines [1 ])
164+ self .assertTrue ('foo restarted' in lines [2 ])
165+ self .assertTrue ('bar not in RUNNING state, NOT restarting' in lines [3 ])
166+ self .assertTrue ('baz:baz_01 not in RUNNING state, NOT restarting' in
167167 lines [4 ])
168168 mailed = prog .mailed .split ('\n ' )
169169 self .assertEqual (len (mailed ), 11 )
@@ -181,11 +181,11 @@ def test_runforever_eager_error_on_process_stop(self):
181181 prog .runforever (test = True )
182182 lines = prog .stderr .getvalue ().split ('\n ' )
183183 #self.assertEqual(len(lines), 5)
184- self .assertIn ("Restarting selected processes ['FAILED']" , lines [0 ])
185- self .assertIn ('foo:FAILED is in RUNNING state, restarting' , lines [1 ])
186- self .assertIn ("Failed to stop process foo:FAILED: "
187- "<Fault 30: 'FAILED'>" , lines [2 ])
188- self .assertIn ('foo:FAILED restarted' , lines [3 ])
184+ self .assertTrue ("Restarting selected processes ['FAILED']" in lines [0 ])
185+ self .assertTrue ('foo:FAILED is in RUNNING state, restarting' in lines [1 ])
186+ self .assertTrue ("Failed to stop process foo:FAILED: "
187+ "<Fault 30: 'FAILED'>" in lines [2 ])
188+ self .assertTrue ('foo:FAILED restarted' in lines [3 ])
189189 mailed = prog .mailed .split ('\n ' )
190190 self .assertEqual (len (mailed ), 10 )
191191 self .assertEqual (mailed [0 ], 'To: chrism@plope.com' )
@@ -202,11 +202,11 @@ def test_runforever_eager_error_on_process_start(self):
202202 prog .runforever (test = True )
203203 lines = prog .stderr .getvalue ().split ('\n ' )
204204 #self.assertEqual(len(lines), 4)
205- self .assertIn ("Restarting selected processes ['SPAWN_ERROR']" , lines [0 ])
206- self .assertIn ('foo:SPAWN_ERROR is in RUNNING state, restarting' ,
205+ self .assertTrue ("Restarting selected processes ['SPAWN_ERROR']" in lines [0 ])
206+ self .assertTrue ('foo:SPAWN_ERROR is in RUNNING state, restarting' in
207207 lines [1 ])
208- self .assertIn ("Failed to start process foo:SPAWN_ERROR: "
209- "<Fault 50: 'SPAWN_ERROR'>" , lines [2 ])
208+ self .assertTrue ("Failed to start process foo:SPAWN_ERROR: "
209+ "<Fault 50: 'SPAWN_ERROR'>" in lines [2 ])
210210 mailed = prog .mailed .split ('\n ' )
211211 self .assertEqual (len (mailed ), 9 )
212212 self .assertEqual (mailed [0 ], 'To: chrism@plope.com' )
@@ -222,18 +222,18 @@ def test_runforever_eager_gcore(self):
222222 prog .stdin .seek (0 )
223223 prog .runforever (test = True )
224224 lines = prog .stderr .getvalue ().split ('\n ' )
225- self .assertIn ("Restarting selected processes ['foo', 'bar', "
226- "'baz_01', 'notexisting']" , lines [0 ])
227- self .assertIn ('gcore output for foo:' , lines [1 ])
225+ self .assertTrue ("Restarting selected processes ['foo', 'bar', "
226+ "'baz_01', 'notexisting']" in lines [0 ])
227+ self .assertTrue ('gcore output for foo:' in lines [1 ])
228228 self .assertEqual (lines [2 ], '' )
229229 self .assertEqual (lines [3 ], ' ' )
230- self .assertIn ('foo is in RUNNING state, restarting' , lines [4 ])
231- self .assertIn ('foo restarted' , lines [5 ])
232- self .assertIn ('bar not in RUNNING state, NOT restarting' , lines [6 ])
233- self .assertIn ('baz:baz_01 not in RUNNING state, NOT restarting' ,
230+ self .assertTrue ('foo is in RUNNING state, restarting' in lines [4 ])
231+ self .assertTrue ('foo restarted' in lines [5 ])
232+ self .assertTrue ('bar not in RUNNING state, NOT restarting' in lines [6 ])
233+ self .assertTrue ('baz:baz_01 not in RUNNING state, NOT restarting' in
234234 lines [7 ])
235- self .assertIn ("Programs not restarted because they did not exist: "
236- "['notexisting']" , lines [8 ])
235+ self .assertTrue ("Programs not restarted because they did not exist: "
236+ "['notexisting']" in lines [8 ])
237237 mailed = prog .mailed .split ('\n ' )
238238 self .assertEqual (len (mailed ), 15 )
239239 self .assertEqual (mailed [0 ], 'To: chrism@plope.com' )
@@ -260,10 +260,10 @@ def test_runforever_not_eager_running(self):
260260 prog .stdin .seek (0 )
261261 prog .runforever (test = True )
262262 lines = [x for x in prog .stderr .getvalue ().split ('\n ' ) if x ]
263- self .assertIn ("Restarting selected processes ['foo', 'bar']" , lines [0 ])
264- self .assertIn ('foo is in RUNNING state, restarting' , lines [1 ])
265- self .assertIn ('foo restarted' , lines [2 ])
266- self .assertIn ('bar not in RUNNING state, NOT restarting' , lines [3 ])
263+ self .assertTrue ("Restarting selected processes ['foo', 'bar']" in lines [0 ])
264+ self .assertTrue ('foo is in RUNNING state, restarting' in lines [1 ])
265+ self .assertTrue ('foo restarted' in lines [2 ])
266+ self .assertTrue ('bar not in RUNNING state, NOT restarting' in lines [3 ])
267267 mailed = prog .mailed .split ('\n ' )
268268 self .assertEqual (len (mailed ), 10 )
269269 self .assertEqual (mailed [0 ], 'To: chrism@plope.com' )
@@ -293,10 +293,11 @@ def test_runforever_connrefused_error(self):
293293 prog .stdin .seek (0 )
294294 prog .runforever (test = True )
295295 lines = [x for x in prog .stderr .getvalue ().split ('\n ' ) if x ]
296- self .assertIn ("Restarting selected processes ['foo', 'bar']" , lines [0 ])
297- self .assertIn ('foo is in RUNNING state, restarting' , lines [1 ])
298- self .assertIn ('foo restarted' , lines [2 ])
299- self .assertIn ('bar not in RUNNING state, NOT restarting' , lines [3 ])
296+ self .assertTrue ("Restarting selected processes ['foo', 'bar']"
297+ in lines [0 ])
298+ self .assertTrue ('foo is in RUNNING state, restarting' in lines [1 ])
299+ self .assertTrue ('foo restarted' in lines [2 ])
300+ self .assertTrue ('bar not in RUNNING state, NOT restarting' in lines [3 ])
300301 mailed = prog .mailed .split ('\n ' )
301302 self .assertEqual (len (mailed ), 10 )
302303 self .assertEqual (mailed [0 ], 'To: chrism@plope.com' )
0 commit comments