def test_helm_init(self, mock_execute, mock_print, mock_sleep): mock_execute.side_effect = [ (None, "error"), ("RBAC created", None), ("Helm init", None), ("false", None), # automountServiceAccountToken ("automountServiceAccountToken updated", None), (None, "error"), # Helm not operational yet ("Helm list", None), ] helm_init() assert mock_execute.call_count == 7 mock_print.assert_called_once_with(".", end="", flush=True) mock_sleep.assert_called_once()
def test_helm_init(self, mock_execute, mock_print, mock_sleep): mock_execute.side_effect = [ None, 'RBAC created', 'Helm init', 'false', # automountServiceAccountToken 'automountServiceAccountToken updated', None, # Helm not operational yet 'Helm list' ] helm_init() assert mock_execute.call_count == 7 mock_print.assert_called_once_with('.', end='', flush=True) mock_sleep.assert_called_once()
def test_helm_init_repeat(self, mock_execute, mock_print, mock_sleep): mock_execute.side_effect = ['Helm list'] helm_init() mock_execute.assert_called_once() mock_print.assert_called_once_with('Helm is already installed!') mock_sleep.assert_not_called()
def test_helm_init_repeat(self, mock_execute, mock_log, mock_sleep): mock_execute.side_effect = [("Helm list", None)] helm_init() mock_execute.assert_called_once() mock_log.info.assert_called_once_with("Helm is already installed!") mock_sleep.assert_not_called()