Esempio n. 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')
Esempio n. 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')
Esempio n. 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')
Esempio n. 4
0
	def test_election1 (self):
		reader = StringIO.StringIO('')
		election = Election()
		election.readCandidates(reader)
		self.assert_(len(election.candidates) == 0)
Esempio n. 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')
Esempio n. 6
0
 def test_election1(self):
     reader = StringIO.StringIO('')
     election = Election()
     election.readCandidates(reader)
     self.assert_(len(election.candidates) == 0)