From cdfccba398936d3b4076343b210ab12713da3b5c Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Wed, 29 Sep 2021 21:19:12 +0200 Subject: [PATCH] Revert "[mod] test_membership_cmd: always success status code" This reverts commit ce759a4e7a541ec3ced19bff44aaa9ee776cd760. Back to previous situation, since send_documentation() is now exiting the error code to the shell --- tests/test_membership.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_membership.py b/tests/test_membership.py index de8d6e2c..acd113f0 100644 --- a/tests/test_membership.py +++ b/tests/test_membership.py @@ -38,7 +38,7 @@ from patched.wot import ( from silkaj import auth, membership, wot from silkaj.blockchain_tools import BlockchainParams, HeadBlock from silkaj.cli import cli -from silkaj.constants import DATE, SUCCESS_EXIT_STATUS +from silkaj.constants import DATE, FAILURE_EXIT_STATUS, SUCCESS_EXIT_STATUS from silkaj.network_tools import ClientInstance from silkaj.tui import display_pubkey_and_checksum @@ -65,15 +65,15 @@ def patched_choose_identity(pubkey): @pytest.mark.parametrize( - "dry_run, display, confirmation", + "dry_run, display, confirmation, exit_code", [ - (True, False, False), - (False, True, False), - (False, True, True), - (False, False, True), + (True, False, False, SUCCESS_EXIT_STATUS), + (False, True, False, SUCCESS_EXIT_STATUS), + (False, True, True, FAILURE_EXIT_STATUS), + (False, False, True, FAILURE_EXIT_STATUS), ], ) -def test_membership_cmd(dry_run, display, confirmation, monkeypatch): +def test_membership_cmd(dry_run, display, confirmation, exit_code, monkeypatch): # Monkeypatch and Mock monkeypatch.setattr(auth, "auth_method", patched_auth_method) monkeypatch.setattr(HeadBlock, "get_head", patched_head_block) @@ -125,7 +125,7 @@ def test_membership_cmd(dry_run, display, confirmation, monkeypatch): # signing_key, # ) - assert result.exit_code == SUCCESS_EXIT_STATUS + assert result.exit_code == exit_code @pytest.mark.parametrize( -- GitLab