Skip to content

Commit

Permalink
Refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shohamc1 committed Feb 2, 2023
1 parent e47befd commit bc55ada
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/functional/feature_on_chain_government.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,14 @@ def run_test(self):
assert_equal(self.nodes[0].listgovproposals(
{"status": "voting", "pagination": {"start": tx1, "including_start": False, "limit": 1}}), nextProposal)

# test listgovproposalvotes aggregation
self.test_aggregation(propId)
self.test_default_cycles_fix()
self.aggregate_all_votes()

def test_aggregation(self, propId):
"""
Tests vote aggregation for a specific proposal. It should respect all provided filters.
"""
votes = self.nodes[0].listgovproposalvotes(propId, 'all', -1, {})
totalVotes = len(votes)
yesVotes = len([x for x in votes if x["vote"] == "YES"])
Expand All @@ -699,9 +706,6 @@ def run_test(self):
assert_equal(votes_aggregate["no"], noVotes)
assert_equal(votes_aggregate["unknown"], unknownVotes)

self.test_default_cycles_fix()
self.aggregate_all_votes()

def test_default_cycles_fix(self):
"""
Tests fix for an issue for when the cycles argument is not provided, the
Expand Down

0 comments on commit bc55ada

Please sign in to comment.