From f7968ead3e1afe56f62f817eced8f3faebfa64db Mon Sep 17 00:00:00 2001 From: Andrew Nikitin Date: Wed, 30 Jan 2019 09:46:47 +0300 Subject: [PATCH] [INDY-1963] Fix errors checking in tests Signed-off-by: Andrew Nikitin --- indy_node/test/suspension/test_nym_suspension.py | 6 +++--- indy_node/test/suspension/test_suspension.py | 2 +- indy_node/test/upgrade/test_pool_upgrade_reject.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/indy_node/test/suspension/test_nym_suspension.py b/indy_node/test/suspension/test_nym_suspension.py index 0e99a46cf..6854e9e84 100644 --- a/indy_node/test/suspension/test_nym_suspension.py +++ b/indy_node/test/suspension/test_nym_suspension.py @@ -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, @@ -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, @@ -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, diff --git a/indy_node/test/suspension/test_suspension.py b/indy_node/test/suspension/test_suspension.py index 1897e5f90..d8f4baf45 100644 --- a/indy_node/test/suspension/test_suspension.py +++ b/indy_node/test/suspension/test_suspension.py @@ -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 diff --git a/indy_node/test/upgrade/test_pool_upgrade_reject.py b/indy_node/test/upgrade/test_pool_upgrade_reject.py index 31b570226..8742e5a80 100644 --- a/indy_node/test/upgrade/test_pool_upgrade_reject.py +++ b/indy_node/test/upgrade/test_pool_upgrade_reject.py @@ -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 @@ -22,7 +22,7 @@ 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, @@ -30,7 +30,7 @@ def testNonTrustyCannotCancelUpgrade(looper, validUpgradeSent, sdk_pool_handle, 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( @@ -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))