Skip to content

Commit

Permalink
add revoke test
Browse files Browse the repository at this point in the history
Signed-off-by: Far <[email protected]>
  • Loading branch information
alexstroke1 authored and Far committed Nov 14, 2024
1 parent f80cfba commit c577162
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"Revoke": {
"Permission": {
"object": {"name": "CanRegisterDomain", "payload": null},
"destination": "ed0120CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03@wonderland"
}
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
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())

0 comments on commit c577162

Please sign in to comment.