def test_is_running(self): b = BConsole() with patch.object(b, 'start_process') as mock_method: start_process = mock_method.return_value start_process.communicate.return_value = ('Version', '') self.assertTrue(b.is_running()) with patch.object(b, 'start_process') as mock_method: start_process = mock_method.return_value start_process.communicate.return_value = ('error', 'error') self.assertFalse(b.is_running())