コード例 #1
0
	def testGSeries_CheckCorrectResult2(self):
		result = problem_4.generateSeries(5)
		self.assertEqual(result, [0,1,1,2,3],  \
			msg = "This should generate the list [0,1,1] ")
コード例 #2
0
	def testGSeries_NotInteger(self):
		result = problem_4.generateSeries("A")
		self.assertEqual(result, 'Not an Integer',  \
			msg = "This should return an empty list")
コード例 #3
0
	def testGSeries_NotLessThanOne2(self):
		result = problem_4.generateSeries(-1)
		self.assertEqual(result, 'The number provided must be an integer geater than 1',  \
			msg = "This should return an error string since -1 is less than 1")
コード例 #4
0
	def testPositiveFibonancciTen(self):
		self.assertEqual(problem_4.generateSeries(10), [0,1,1,2,3,5,8,13,21,34,55], msg="fibonancci should return [0,1,1,2,3,5,8,13,21,34,55]")
コード例 #5
0
	def testNegativeFibonancci(self):
		self.assertEqual(problem_4.generateSeries(-9), -1, msg="Fibonancci should return false for a negative number")
コード例 #6
0
	def testAlphabeticalInput(self):
		self.assertEqual(problem_4.generateSeries('etuyuh'), -1, msg="Fibonancci should return false for a alphabetical letters")

		'''This section handles the test for the Function generateSeriesSum'''
コード例 #7
0
	def testPositiveFibonancci(self):
		self.assertEqual(problem_4.generateSeries(5), [0,1,1,2,3,5], msg="fibonancci should return [0,1,1,2,3,5]")
コード例 #8
0
 def testGSeries_CheckCorrectResult2(self):
     result = problem_4.generateSeries(5)
     self.assertEqual(result, [0,1,1,2,3],  \
      msg = "This should generate the list [0,1,1] ")
コード例 #9
0
	def testDecimalInput(self):
		self.assertEqual(problem_4.generateSeries(4.25), -1, msg="Fibonancci should return false for a decimal")
コード例 #10
0
 def testGSeries_NotInteger(self):
     result = problem_4.generateSeries("A")
     self.assertEqual(result, 'Not an Integer',  \
      msg = "This should return an empty list")
コード例 #11
0
 def testGSeries_NotLessThanOne2(self):
     result = problem_4.generateSeries(-1)
     self.assertEqual(result, 'The number provided must be an integer geater than 1',  \
      msg = "This should return an error string since -1 is less than 1")
コード例 #12
0
 def testPositiveFibonancciTen(self):
     self.assertEqual(
         problem_4.generateSeries(10),
         [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55],
         msg="fibonancci should return [0,1,1,2,3,5,8,13,21,34,55]")
コード例 #13
0
 def testPositiveFibonancci(self):
     self.assertEqual(problem_4.generateSeries(5), [0, 1, 1, 2, 3, 5],
                      msg="fibonancci should return [0,1,1,2,3,5]")
コード例 #14
0
 def testAlphabeticalInput(self):
     self.assertEqual(
         problem_4.generateSeries('etuyuh'),
         -1,
         msg="Fibonancci should return false for a alphabetical letters")
     '''This section handles the test for the Function generateSeriesSum'''
コード例 #15
0
 def testDecimalInput(self):
     self.assertEqual(problem_4.generateSeries(4.25),
                      -1,
                      msg="Fibonancci should return false for a decimal")
コード例 #16
0
 def testNegativeFibonancci(self):
     self.assertEqual(
         problem_4.generateSeries(-9),
         -1,
         msg="Fibonancci should return false for a negative number")