Skip to content

Commit

Permalink
[INDY-1963] Fix errors checking in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Nikitin <[email protected]>
  • Loading branch information
Andrew Nikitin committed Jan 30, 2019
1 parent 636b4be commit f7968ea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions indy_node/test/suspension/test_nym_suspension.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def testTrusteeSuspendingTrustAnchor(looper, sdk_pool_handle, sdk_wallet_trustee
sdk_suspend_role(looper, sdk_pool_handle, sdk_wallet_trustee, did)
with pytest.raises(RequestRejectedException) as e:
sdk_add_new_nym(looper, sdk_pool_handle, sdk_wallet_trust_anchor)
e.match('There is no accepted constraint')
e.match('Rule for this action is')


def testTrusteeSuspendingTrustee(looper, sdk_pool_handle, sdk_wallet_trustee,
Expand All @@ -22,7 +22,7 @@ def testTrusteeSuspendingTrustee(looper, sdk_pool_handle, sdk_wallet_trustee,
sdk_suspend_role(looper, sdk_pool_handle, sdk_wallet_trustee, did)
with pytest.raises(RequestRejectedException) as e:
sdk_add_new_nym(looper, sdk_pool_handle, another_trustee)
e.match('There is no accepted constraint')
e.match('Rule for this action is')


def testTrusteeSuspendingSteward(looper, sdk_pool_handle, sdk_wallet_trustee,
Expand All @@ -31,7 +31,7 @@ def testTrusteeSuspendingSteward(looper, sdk_pool_handle, sdk_wallet_trustee,
sdk_suspend_role(looper, sdk_pool_handle, sdk_wallet_trustee, did)
with pytest.raises(RequestRejectedException) as e:
sdk_add_new_nym(looper, sdk_pool_handle, sdk_wallet_steward)
e.match('There is no accepted constraint')
e.match('Rule for this action is')


def testTrustAnchorSuspendingHimselfByVerkeyFlush(looper, sdk_pool_handle,
Expand Down
2 changes: 1 addition & 1 deletion indy_node/test/suspension/test_suspension.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def testTrusteeSuspensionByTrustee(looper, sdk_pool_handle, sdk_wallet_trustee,
_, did = sdk_wallet_trustee
with pytest.raises(RequestRejectedException) as e:
sdk_suspend_role(looper, sdk_pool_handle, another_steward1, did)
e.match('role is not accepted')
e.match('{} can not do this action'.format(STEWARD_STRING))


# Keep the test below at the end of the suite since it will make one of the
Expand Down
8 changes: 4 additions & 4 deletions indy_node/test/upgrade/test_pool_upgrade_reject.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from copy import deepcopy

from plenum.common.constants import NAME, VERSION
from plenum.common.constants import NAME, VERSION, STEWARD_STRING
from plenum.common.exceptions import RequestNackedException, RequestRejectedException
from indy_common.constants import CANCEL, \
ACTION
Expand All @@ -22,15 +22,15 @@ def testOnlyTrusteeCanSendPoolUpgrade(looper, sdk_pool_handle, sdk_wallet_stewar
validUpgrade[NAME] = 'upgrade-20'
validUpgrade[VERSION] = bumpedVersion(validUpgrade['version'])
req = sdk_send_upgrade(looper, sdk_pool_handle, sdk_wallet_steward, validUpgrade)
sdk_get_bad_response(looper, [req], RequestRejectedException, 'role is not accepted')
sdk_get_bad_response(looper, [req], RequestRejectedException, '{} can not do this action'.format(STEWARD_STRING))


def testNonTrustyCannotCancelUpgrade(looper, validUpgradeSent, sdk_pool_handle,
sdk_wallet_steward, validUpgrade):
validUpgradeCopy = deepcopy(validUpgrade)
validUpgradeCopy[ACTION] = CANCEL
req = sdk_send_upgrade(looper, sdk_pool_handle, sdk_wallet_steward, validUpgradeCopy)
sdk_get_bad_response(looper, [req], RequestRejectedException, 'role is not accepted')
sdk_get_bad_response(looper, [req], RequestRejectedException, '{} can not do this action'.format(STEWARD_STRING))


def test_accept_then_reject_upgrade(
Expand All @@ -48,4 +48,4 @@ def test_accept_then_reject_upgrade(
def testOnlyTrusteeCanSendPoolUpgradeForceTrue(
looper, sdk_pool_handle, sdk_wallet_steward, validUpgradeExpForceTrue):
req = sdk_send_upgrade(looper, sdk_pool_handle, sdk_wallet_steward, validUpgradeExpForceTrue)
sdk_get_bad_response(looper, [req], RequestNackedException, 'role is not accepted')
sdk_get_bad_response(looper, [req], RequestNackedException, '{} can not do this action'.format(STEWARD_STRING))

0 comments on commit f7968ea

Please sign in to comment.