-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
pytests/iroha_cli_tests/common/json_isi_examples/revoke_permission.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"Revoke": { | ||
"Permission": { | ||
"object": {"name": "CanRegisterDomain", "payload": null}, | ||
"destination": "ed0120CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03@wonderland" | ||
} | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
pytests/iroha_cli_tests/test/permissions/test_revoke_permissions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()) |