diff --git a/pytests/iroha_cli_tests/common/json_isi_examples/revoke_permission.json b/pytests/iroha_cli_tests/common/json_isi_examples/revoke_permission.json new file mode 100644 index 00000000000..960912c7255 --- /dev/null +++ b/pytests/iroha_cli_tests/common/json_isi_examples/revoke_permission.json @@ -0,0 +1,10 @@ +[ + { + "Revoke": { + "Permission": { + "object": {"name": "CanRegisterDomain", "payload": null}, + "destination": "ed0120CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03@wonderland" + } + } + } +] diff --git a/pytests/iroha_cli_tests/test/permissions/test_grant_permissions.py b/pytests/iroha_cli_tests/test/permissions/test_grant_permissions.py index f8ddd71f08c..a73c44205d5 100644 --- a/pytests/iroha_cli_tests/test/permissions/test_grant_permissions.py +++ b/pytests/iroha_cli_tests/test/permissions/test_grant_permissions.py @@ -29,7 +29,7 @@ def test_grant_permission( ): assert iroha_cli.should(have.transaction_hash()) -@allure.label("sdk_test_id", "unregister_asset") +@allure.label("sdk_test_id", "grant_not_permitted_permission") @allure.label("permission", "no_permission_required") def test_grant_not_permitted_permission( GIVEN_registered_account, diff --git a/pytests/iroha_cli_tests/test/permissions/test_revoke_permissions.py b/pytests/iroha_cli_tests/test/permissions/test_revoke_permissions.py new file mode 100644 index 00000000000..cd96058a653 --- /dev/null +++ b/pytests/iroha_cli_tests/test/permissions/test_revoke_permissions.py @@ -0,0 +1,32 @@ +import allure # type: ignore +import pytest + +from ...common.consts import Stderr +from ...src.iroha_cli import iroha_cli, have, iroha + + +@pytest.fixture(scope="function", autouse=True) +def story_account_unregisters_asset(): + allure.dynamic.story("Account revoke permission") + +@allure.label("sdk_test_id", "revoke_permission") +@allure.label("permission", "no_permission_required") +@pytest.mark.xfail(reason="") +def test_revoke_permission( + GIVEN_registered_account, + GIVEN_account_granted_with_CanSetParameters, + GIVEN_currently_authorized_account +): + with allure.step( + f'WHEN "{GIVEN_currently_authorized_account}" revokes ' + f'the account "{GIVEN_registered_account}" with permission CanSetParameters' + ): + iroha_cli.grant_permission( + destination=GIVEN_registered_account, + permission='CanSetParameters' + ) + + with allure.step( + f'THEN the account "{GIVEN_registered_account}" should have the revoked permission' + ): + assert iroha_cli.should(have.transaction_hash()) \ No newline at end of file