def test3(out): trueAns = 13 studAns = fib(7) maxpoints = '2' out.append("Test 3") result = str(studAns == trueAns) if (result == 'True'): result = '2' else: result = '0' out.append(result) out.append(maxpoints) error = "" if (studAns != trueAns): error = "Your answer was wrong" out.append(error)
def test1(out): trueAns = 1 studAns = fib(1) maxpoints = '1' out.append('Test 1') result = str(studAns == trueAns) if (result == 'True'): result = '1' else: result = '0' out.append(result) out.append(maxpoints) error = '' if (studAns != trueAns): error = 'Your answer was wrong' output.append(error)
def test_zero(self): self.assertEqual(fib(0), 0)
def test_integer(self): self.assertEqual(fib(7), 13)
def test_one(self): self.assertEqual(fib(1), 1)