Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
 def test_zero(self):
     self.assertEqual(fib(0), 0)
Ejemplo n.º 5
0
 def test_integer(self):
     self.assertEqual(fib(7), 13)
Ejemplo n.º 6
0
 def test_one(self):
     self.assertEqual(fib(1), 1)