r2b2.tests.util

Module Contents

r2b2.tests.util.generate_contest(size)[source]

Generate a Contest with random data. For testing purposes only.

Note

Currently this only generates 2 candidate Plurality contests with 1 winner.

r2b2.tests.util.generate_election(max_size, max_contests=None)[source]

Generate an Election with random data. For testing purposes only.

r2b2.tests.util.parse_contest_list(json_file)[source]

Parse a list of Contests from a JSON file.

Note

Template for Contest format in JSON in contest_template.json

r2b2.tests.util.parse_contest(json_file)[source]

Parse a single Contest from a JSON file.

Note

Template for Contest format in JSON in single_contest_template.json

r2b2.tests.util.parse_election(json_file)[source]

Parse an Eleciton from a JSON file.

Note

Templace for Election JSON format in election_template.json