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)
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()
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()
def test_helm_env_vars_emptyerror(self, mock_secret_read): with pytest.raises(TypeError): helm_env_vars() mock_secret_read.assert_not_called()
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()
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()
def test_helm_env_vars_empty(self, mock_secret_read): result = helm_env_vars(None) assert result == "" mock_secret_read.assert_not_called()