diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index abb3849..61ce47a 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -144,7 +144,7 @@ def application(account, application_plan, application_params) -> Application: @pytest.fixture(scope='module') def app_key_params(account, application): - value = ''.join(random.choices(string.ascii_uppercase + string.digits + '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~', k=100)) + value = ''.join(random.choices(string.ascii_uppercase + string.digits + '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~', k=255)) return({"application_id": application["id"], "account_id": account["id"], "key": value}) diff --git a/tests/integration/test_integration_application.py b/tests/integration/test_integration_application.py index 051bc99..0cbdf35 100644 --- a/tests/integration/test_integration_application.py +++ b/tests/integration/test_integration_application.py @@ -1,5 +1,6 @@ import random import string +import base64 import secrets import pytest @@ -38,8 +39,17 @@ def test_application_key_list(application, app_key): keys = application.keys.list() assert len(keys) > 0 + def test_application_update_userkey(application): - new_key = "".join(random.choices(string.ascii_letters + string.digits + "-_.", k=100)) + new_key = "".join(random.choices(string.ascii_letters + string.digits + "-_.", k=255)) + updated_application = application.update(params={"user_key": new_key}) + asserts.assert_resource(updated_application) + assert updated_application["user_key"] == new_key + + +def test_application_update_userkey_base64(application): + new_key = "".join(random.choices(string.ascii_letters + string.digits + "-_.", k=41)) + new_key = base64.b64encode(new_key.encode('ascii')).decode() updated_application = application.update(params={"user_key": new_key}) asserts.assert_resource(updated_application) assert updated_application["user_key"] == new_key