def test_commitments_matrix(self): adapter = CommitmentsAdapter(self.election, [self.p1, self.p3]) expected_commitments_matrix = [[1, 1], [1, 1], [0,0]] C = adapter.get_commitments_matrix().tolist() self.assertEquals(C, expected_commitments_matrix)
def test_get_ones(self): adapter = CommitmentsAdapter(self.election, [self.p1, self.p3]) self.assertEquals(len(adapter.ones), 2)
def test_get_result(self): adapter = CommitmentsAdapter(self.election, [self.p1, self.p3]) calculator = Calculator(self.election) calculator.set_commitments_adapter(adapter) R = calculator.get_commitments_result().tolist() self.assertEquals(R, [[2], [2], [0]])
def test_commitments_matrix(self): adapter = CommitmentsAdapter(self.election, [self.p1, self.p3]) expected_commitments_matrix = [[1, 1], [1, 1], [0, 0]] C = adapter.get_commitments_matrix().tolist() self.assertEquals(C, expected_commitments_matrix)