I have a practice scenerio to define a test test_isEven1, inside TestIsEvenMethod, that checks if isEven(5) returns False or not. i tried to run below piece of code but its not going through:
import unittest
class TestIsEvenMethod(unittest.TestCase):
def isEven(n):
if n%2==0:
print(“True”)
else:
print(“False”)
def test_isEven1(self):
result = isEven(5)
self.assertEqual(result,false)
if name == ‘main’:
unittest.main()
Error i am getting is -
E
ERROR: C:\Users\John\AppData\Roaming\jupyter\runtime\kernel-b2f7f45b-818e-401f-a3b3-503a1eabbdc4 (unittest.loader._FailedTest)
AttributeError: module ‘main’ has no attribute ‘C:\Users\John\AppData\Roaming\jupyter\runtime\kernel-b2f7f45b-818e-401f-a3b3-503a1eabbdc4’
Ran 1 test in 0.005s
FAILED (errors=1)
Any Helps?