From bba82a86b137c73832ad7b6a397d3db24fcc625f Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Thu, 26 Dec 2024 22:58:37 +0100 Subject: Add encrypted values to ETOOLKIT_SENSITIVE implicitly --- tests/conftest.py | 5 +++++ tests/test_envtoolkit_instance.py | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/conftest.py b/tests/conftest.py index 37dd184..a4463fd 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -49,6 +49,11 @@ def config_data(): '+YYrZbwTBuG0Pl+WMQrvxLUtq5j8qYuQqz' 'oIwgoGt7AaWZCJz+E7qoDeg3wke70ST8U=' ), + 'ETOOLKIT_TEST_PASSWORD2': ( + 'enc-val$2$RCSZqq9pWrRDoCVYVHopyu1LzaJGfv8roVviqrLTBxM=$' + '+YYrZbwTBuG0Pl+WMQrvxLUtq5j8qYuQqz' + 'oIwgoGt7AaWZCJz+E7qoDeg3wke70ST8U=' + ), }, }, } diff --git a/tests/test_envtoolkit_instance.py b/tests/test_envtoolkit_instance.py index 9873d57..f555f81 100644 --- a/tests/test_envtoolkit_instance.py +++ b/tests/test_envtoolkit_instance.py @@ -31,7 +31,8 @@ def test_instantiation(config_data): instance = etoolkit.EtoolkitInstance('secret', config_data) assert 'ETOOLKIT_PARENT' not in instance.raw_env_variables assert 'ETOOLKIT_SENSITIVE' not in instance.raw_env_variables - assert 'DB_CONNECTION' not in instance.sensitive_env_variables + assert 'GNUPGHOME' not in instance.sensitive_env_variables + assert 'ETOOLKIT_TEST_PASSWORD2' not in instance.sensitive_env_variables assert 'ETOOLKIT_TEST_PASSWORD' in instance.sensitive_env_variables assert instance.name == 'secret' assert ( @@ -64,6 +65,7 @@ def test_get_environ( env = instance.get_environ() assert isinstance(env, dict) assert env['ETOOLKIT_TEST_PASSWORD'] == short_value + assert 'ETOOLKIT_TEST_PASSWORD2' in instance.sensitive_env_variables def test_get_full_name(config_data): -- cgit v1.3