Skip to content

Commit

Permalink
Merge pull request #2177 from IntersectMBO/fix_no_cc_votes
Browse files Browse the repository at this point in the history
Fix check on missing cc votes
  • Loading branch information
mkoura authored Jan 18, 2024
2 parents 9fdbe79 + 1c2b544 commit c46119f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions cardano_node_tests/tests/tests_conway/test_voting.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,12 @@ def _check_state(state: dict):
req_cli20.success()

# Check vote view
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=voted_votes.cc[0])
if voted_votes.cc:
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=voted_votes.cc[0])
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=voted_votes.drep[0])

@allure.link(helpers.get_vcs_link())
def test_add_new_committee_member(
def test_add_new_committee_member( # noqa: C901
self,
cluster_lock_governance: governance_setup.GovClusterT,
pool_user_lg: clusterlib.PoolUser,
Expand Down Expand Up @@ -695,7 +696,8 @@ def _check_state(state: dict):
governance_utils.check_action_view(cluster_obj=cluster, action_data=update_action)

# Check vote view
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=voted_votes.cc[0])
if voted_votes.cc:
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=voted_votes.cc[0])
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=voted_votes.drep[0])
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=voted_votes.spo[0])

Expand Down Expand Up @@ -943,7 +945,8 @@ def _check_state(state: dict):
raise

# Check vote view
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=voted_votes.cc[0])
if voted_votes.cc:
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=voted_votes.cc[0])
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=voted_votes.drep[0])

@allure.link(helpers.get_vcs_link())
Expand Down Expand Up @@ -1203,7 +1206,8 @@ def _cast_vote(approve: bool, vote_id: str, add_spo_votes: bool = False) -> Vote
governance_utils.check_action_view(cluster_obj=cluster, action_data=withdrawal_actions[0])

# Check vote view
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=voted_votes.cc[0])
if voted_votes.cc:
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=voted_votes.cc[0])
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=voted_votes.drep[0])

@allure.link(helpers.get_vcs_link())
Expand Down Expand Up @@ -1656,7 +1660,8 @@ def _get_vote(idx: int) -> clusterlib.Votes:

# Check vote view
req_cli22.start(url=helpers.get_vcs_link())
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_cc[0])
if votes_cc:
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_cc[0])
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_drep[0])
governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_spo[0])
req_cli22.success()
Expand Down

0 comments on commit c46119f

Please sign in to comment.