-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunittests.py
30 lines (23 loc) · 995 Bytes
/
unittests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import unittest
import login
class TestMyStuff(unittest.TestCase):
#write our test cases
#assert means we are assuming something to be true
#below testcases are for login validation
def test_1(self):
self.assertEqual(True,login.loginvalidationreturn('mukul','mukul123'))
def test_2(self):
self.assertEqual(False,login.loginvalidationreturn('ewgew','mukul123'))
def test_3(self):
self.assertEqual(True,login.loginvalidationreturn('omkar','omkar123'))
#the below test cases are for dictionary word checking(whether they are present in json or not)
def test_4(self):
self.assertEqual(False,login.check_wrd("esewvgewvwvgew"))
def test_5(self):
self.assertEqual(True,login.check_wrd("rain"))
def test_6(self):
self.assertEqual(True,login.check_wrd("qwe"))
def main():
suite=unittest.TestLoader().loadTestsFromTestCase(TestMyStuff)
unittest.TextTestRunner(verbosity=3).run(suite)
main()