Пример #1
0
 def test_helm_env_vars_preserve(self, mock_secret_read):
     mock_secret_read.side_effect = [{'BAR_ENV': 'sausage'}]
     result = helm_env_vars('a-namespace',
                            env_vars=(('foo', 'bar'), ),
                            preserve=(('a-secret', 'BAR_ENV', 'egg'), ))
     assert result == ' --set foo=bar --set egg=sausage'
     mock_secret_read.assert_called_once_with('a-secret',
                                              'a-namespace',
                                              verbose=False)
Пример #2
0
 def test_helm_env_vars_values(self, mock_secret_read):
     result = helm_env_vars('a-namespace',
                            env_vars=(('foo', 'bar'), ('egg', 'sausage',
                                                       True)))
     assert result == ' --set foo=bar --set-string egg=sausage'
     mock_secret_read.assert_not_called()
Пример #3
0
 def test_helm_env_vars_empty(self, mock_secret_read):
     result = helm_env_vars('a-namespace', env_vars=None)
     assert result == ''
     mock_secret_read.assert_not_called()
Пример #4
0
 def test_helm_env_vars_emptyerror(self, mock_secret_read):
     with pytest.raises(TypeError):
         helm_env_vars()
     mock_secret_read.assert_not_called()
Пример #5
0
 def test_helm_env_vars_bad(self, mock_secret_read):
     with pytest.raises(TypeError):
         helm_env_vars(("foo", "egg"))
     mock_secret_read.assert_not_called()
Пример #6
0
 def test_helm_env_vars_values(self, mock_secret_read):
     result = helm_env_vars((("foo", "bar"), ("egg", "sausage", True)))
     assert result == " --set foo=bar --set-string egg=sausage"
     mock_secret_read.assert_not_called()
Пример #7
0
 def test_helm_env_vars_empty(self, mock_secret_read):
     result = helm_env_vars(None)
     assert result == ""
     mock_secret_read.assert_not_called()