예제 #1
0
	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')
예제 #2
0
 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')
예제 #3
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')
예제 #4
0
	def test_election1 (self):
		reader = StringIO.StringIO('')
		election = Election()
		election.readCandidates(reader)
		self.assert_(len(election.candidates) == 0)
예제 #5
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')
예제 #6
0
 def test_election1(self):
     reader = StringIO.StringIO('')
     election = Election()
     election.readCandidates(reader)
     self.assert_(len(election.candidates) == 0)