-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_ccvalidator.py
45 lines (34 loc) · 1.06 KB
/
test_ccvalidator.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import unittest
import ccval
class TestSum(unittest.TestCase):
def test_startwith4(self):
data = "45"
result = ccval.startwith(data)
self.assertEqual(result, True)
def test_startwith5(self):
data = "55"
result = ccval.startwith(data)
self.assertEqual(result, True)
def test_startwith6(self):
data = "65"
result = ccval.startwith(data)
self.assertEqual(result, True)
def test_startwith37(self):
data = "3765"
result = ccval.startwith(data)
self.assertEqual(result, True)
def test_startwith34(self):
data = "3465"
result = ccval.startwith(data)
self.assertEqual(result, True)
def test_startwith35(self):
data = "3565"
result = ccval.startwith(data)
self.assertEqual(result, True)
def test_luhn_check(self):
data = "79927398713"
result = ccval.luhn_check(data)
self.assertEqual(result, True)
if __name__ == "__main__":
unittest.main()
print("Completed all test Successfully")