Skip to content
Snippets Groups Projects
Commit cdfccba3 authored by Moul's avatar Moul
Browse files

Revert "[mod] test_membership_cmd: always success status code"

This reverts commit ce759a4e.
Back to previous situation, since send_documentation()
is now exiting the error code to the shell
parent f426b743
No related branches found
No related tags found
1 merge request!196#390: send_document(): Exit the program in case an HTTPError exception is raised
Pipeline #14051 passed
......@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment