def test_partition_eligible_votes():

    class TestVoting(Voting):

        @classmethod
        def verify_vote_signature(cls, vote):
            if (vote['node_pubkey'] == 'invalid sig'):
                return False
            if (vote['node_pubkey'] == 'value error'):
                raise ValueError()
            return True
    voters = ['valid', 'invalid sig', 'value error', 'not in set']
    votes = [{'node_pubkey': k} for k in voters]
    (el, inel) = TestVoting.partition_eligible_votes(votes, voters[:(- 1)])
    assert (el == [votes[0]])
    assert (inel == votes[1:])
def test_partition_eligible_votes():

    class TestVoting(Voting):

        @classmethod
        def verify_vote_signature(cls, vote):
            if (vote['node_pubkey'] == 'invalid sig'):
                return False
            if (vote['node_pubkey'] == 'value error'):
                raise ValueError()
            return True
    voters = ['valid', 'invalid sig', 'value error', 'not in set']
    votes = [{'node_pubkey': k} for k in voters]
    (el, inel) = TestVoting.partition_eligible_votes(votes, voters[:(- 1)])
    assert (el == [votes[0]])
    assert (inel == votes[1:])