Skip to content

Commit

Permalink
Fix failing test - we need to pass encrypted value to the KVP model.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kami committed Apr 10, 2021
1 parent 4d3be4a commit 574034f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion st2common/tests/unit/test_config_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
from st2common.models.db.keyvalue import KeyValuePairDB
from st2common.exceptions.db import StackStormDBObjectNotFoundError
from st2common.persistence.keyvalue import KeyValuePair
from st2common.models.api.keyvalue import KeyValuePairAPI
from st2common.services.config import set_datastore_value_for_config_key
from st2common.util.config_loader import ContentPackConfigLoader
from st2common.util import crypto

from st2tests.base import CleanDbTestCase

Expand Down Expand Up @@ -522,8 +524,11 @@ def test_get_config_dynamic_config_item_under_additional_properties(self):
pack_name = "dummy_pack_schema_with_additional_properties_1"
loader = ContentPackConfigLoader(pack_name=pack_name)

encrypted_value = crypto.symmetric_encrypt(
KeyValuePairAPI.crypto_key, "v1_encrypted"
)
KeyValuePair.add_or_update(
KeyValuePairDB(name="k1_encrypted", value="v1_encrypted", secret=True)
KeyValuePairDB(name="k1_encrypted", value=encrypted_value, secret=True)
)

####################
Expand Down

0 comments on commit 574034f

Please sign in to comment.