Exemplo n.º 1
0
 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()
Exemplo n.º 2
0
 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()
Exemplo n.º 3
0
 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()
Exemplo n.º 4
0
 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()