def test_recommendations_parties(sample_vote): grouped = sample_vote.recommendations_parties codes = SwissVote.codes('recommendation') # Remove entries in codes for unknown and actor no longer exists del codes[9999] del codes[None] # print(grouped.keys()) # print(codes.values()) assert list(grouped.keys()) == list(codes.values())
def test_recommendation_order(): recommendations = SwissVote.codes('recommendation') assert list(recommendations.keys()) == [1, 2, 4, 5, 3, 66, 9999, None]
def test_vote_codes(): assert SwissVote.codes('legal_form')[2] == "Optional referendum" assert SwissVote.codes('result')[0] == "Rejected" assert SwissVote.codes('result_people_accepted')[0] == "Rejected" assert SwissVote.codes('result_cantons_accepted')[0] == "Rejected" assert SwissVote.codes('result_ai_accepted')[1] == "Accepted" assert SwissVote.codes('department_in_charge')[8] == \ "Federal Chancellery (FCh)" assert SwissVote.codes('position_federal_council')[3] == "None" assert SwissVote.codes('position_parliament')[2] == "Rejecting" assert SwissVote.codes('position_national_council')[2] == "Rejecting" assert SwissVote.codes('position_council_of_states')[2] == "Rejecting" assert SwissVote.codes('recommendation')[5] == "Free vote"