def test_election3 (self): reader = StringIO.StringIO('2\nJohn Doe\nJane Smith\n') election = Election() election.readCandidates(reader) self.assert_(len(election.candidates) == 2) self.assert_(str(election.candidates[0]) == 'John Doe') self.assert_(str(election.candidates[1]) == 'Jane Smith')
def test_election3(self): reader = StringIO.StringIO('2\nJohn Doe\nJane Smith\n') election = Election() election.readCandidates(reader) self.assert_(len(election.candidates) == 2) self.assert_(str(election.candidates[0]) == 'John Doe') self.assert_(str(election.candidates[1]) == 'Jane Smith')
def test_election2 (self): reader = StringIO.StringIO('1\nJohn Doe\n') election = Election() election.readCandidates(reader) self.assert_(len(election.candidates) == 1) self.assert_(str(election.candidates[0]) == 'John Doe')
def test_election1 (self): reader = StringIO.StringIO('') election = Election() election.readCandidates(reader) self.assert_(len(election.candidates) == 0)
def test_election2(self): reader = StringIO.StringIO('1\nJohn Doe\n') election = Election() election.readCandidates(reader) self.assert_(len(election.candidates) == 1) self.assert_(str(election.candidates[0]) == 'John Doe')
def test_election1(self): reader = StringIO.StringIO('') election = Election() election.readCandidates(reader) self.assert_(len(election.candidates) == 0)