def testC_increment3 (self): c = Candidate("Josh", 1) c.increment([1, 2, 3]) c.increment([1, 2, 3]) c.increment([1, 3, 2]) self.assertEqual(c.count, 3) self.assertEqual(c.ballots, [[1, 2, 3], [1, 2, 3], [1, 3, 2]])
def test_candidate4(self): candidate = Candidate('John Doe') candidate.add(Ballot('')) candidate.add(Ballot('')) candidate.add(Ballot('')) self.assert_(str(candidate) == 'John Doe') self.assert_(candidate.numVotes() == 3)
def test_candidate4 (self): candidate = Candidate('John Doe') candidate.add(Ballot('')) candidate.add(Ballot('')) candidate.add(Ballot('')) self.assert_(str(candidate) == 'John Doe') self.assert_(candidate.numVotes() == 3)
def testC_increment2 (self): c = Candidate("Fiona", 1) c.increment([1, 2, 3]) self.assertEqual(c.count, 1) self.assertEqual(c.ballots, [[1, 2, 3]])
def testC_increment1 (self): c = Candidate("Prateek", 1) c.increment([1, 2]) self.assertEqual(c.count, 1) self.assertEqual(c.ballots, [[1, 2]])
def testCgetinfo3 (self): c = Candidate("Glenn Downing", 500) c.count = 2 c.ballots.append([1, 2, 3]) c.ballots.append([1, 3, 2]) self.assertEqual(c.getinfo(), ('Glenn Downing', 500, 2, [[1, 2, 3], [1, 3, 2]], True))
def testCgetinfo2 (self): c = Candidate("Mitt Romney", 1) c.count = 1 c.ballots.append([1, 2, 3]) self.assertEqual(c.getinfo(), ('Mitt Romney', 1, 1, [[1, 2, 3]], True))
def testCgetinfo1 (self): c = Candidate("Barack Obama", 1) c.count = 1 c.ballots.append(1) c.running = False self.assertEqual(c.getinfo(), ('Barack Obama', 1, 1, [1], False))
def test_candidate2 (self): candidate = Candidate('John Doe') self.assert_(str(candidate) == 'John Doe') self.assert_(candidate.numVotes() == 0)
def test_candidate1 (self): candidate = Candidate('') self.assert_(str(candidate) == '') self.assert_(candidate.numVotes() == 0)
def test_candidate2(self): candidate = Candidate('John Doe') self.assert_(str(candidate) == 'John Doe') self.assert_(candidate.numVotes() == 0)
def test_candidate1(self): candidate = Candidate('') self.assert_(str(candidate) == '') self.assert_(candidate.numVotes() == 0)