def testcover_main_WHEN_timeout(self, mock_check_status, mock_stdout): mock_check_status.side_effect = check_collectd_mlab.TimeoutError('timeout') with self.assertRaises(SystemExit): check_collectd_mlab.main() self.assertTrue(mock_stdout.write.called) self.assertTrue(mock_check_status.called)
def testcover_main(self, mock_check_status, mock_stdout): mock_check_status.return_value = (check_collectd_mlab.STATE_OK, 'ok') with self.assertRaises(SystemExit): check_collectd_mlab.main() self.assertTrue(mock_stdout.write.called) self.assertTrue(mock_check_status.called)