-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYogaTestPatient.py
91 lines (83 loc) · 3.5 KB
/
YogaTestPatient.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import os,sys, unittest
from yoga.patient import patient
class TestPatient(unittest.TestCase):
@classmethod
def setUpClass(cls):
print('setupClass')
cls.p1=patient.Patient(1, 'pass1', 'Mr.','Rajeev', 'Ranjan', 'Roy')
#cls.p1.display()
cls.p2=patient.Patient(2, 'pass2', 'Mr.','Mohsen', '', 'Zardadi')
#cls.p2.display()
@classmethod
def tearDownClass(cls):
print('teardownClass')
del cls.p1
del cls.p2
def setUp(self):
self.p3=patient.Patient(3, 'pass3', 'Mr.','Mohan', 'Singh','Agashe')
self.p4=patient.Patient(4, 'pass4', 'Mr.','Ramesh', 'Mohan','Agashe')
self.p5=patient.Patient(5, 'pass5', 'Mr.','Amit', 'Ramlal','Ganeriwalla')
self.p6=patient.Patient(6, 'pass6', 'Mr.','Shree', 'Narayan','Roy')
self.p7=patient.Patient(7, 'pass7', 'Mr.','Shailesh', 'Nandan','Singh')
print('Setup')
def tearDown(self):
print('Teardown')
del self.p3
del self.p4
del self.p5
del self.p6
del self.p7
def test_getfName(self):
self.assertEqual(patient.Patient.getfName(self.p3),'Mohan')
self.p3.setfName('Suresh')
self.assertEqual(patient.Patient.getfName(self.p3),'Suresh')
self.p3.setfName('Karan')
self.assertEqual(patient.Patient.getfName(self.p3),'Karan')
self.p3.setfName('Lila Ramesh')
self.assertEqual(patient.Patient.getfName(self.p3),'Lila Ramesh')
self.p3.setfName('Arjun')
self.assertEqual(patient.Patient.getfName(self.p3),'Arjun')
def test_setfName(self):
self.p3.setfName('Kareem')
self.p4.setfName('Ram')
self.p5.setfName('Mohan')
self.p6.setfName('Amit')
self.p7.setfName('Shree')
self.assertEqual(self.p3._Patient__fName,'Kareem')
self.assertEqual(self.p4._Patient__fName,'Ram')
self.assertEqual(self.p5._Patient__fName,'Mohan')
self.assertEqual(self.p6._Patient__fName,'Amit')
self.assertEqual(self.p7._Patient__fName,'Shree')
def test_AddRev(self):
self.p1.addRev(100)
self.assertEqual(self.p1.getRev(),100)
self.assertEqual(self.p1.addRev('ab'), 'Invalid')
def test_getlName(self):
self.p3.setlName("Mohan")
self.assertEqual(patient.Patient.getlName(self.p3),'Mohan')
self.p3.setlName('Suresh')
self.assertEqual(patient.Patient.getlName(self.p3),'Suresh')
def test_setlName(self):
self.p3.setlName("Mohan")
self.assertEqual(patient.Patient.getlName(self.p3),'Mohan')
self.p3.setlName('Suresh')
self.assertEqual(patient.Patient.getlName(self.p3),'Suresh')
def test_getmName(self):
self.p3.setmName("Mohan")
self.assertEqual(patient.Patient.getmName(self.p3),'Mohan')
self.p3.setmName('Suresh')
self.assertEqual(patient.Patient.getmName(self.p3),'Suresh')
def test_setmName(self):
self.p3.setmName("Mohan")
self.assertEqual(patient.Patient.getmName(self.p3),'Mohan')
self.p3.setmName('Mohsen')
self.assertEqual(patient.Patient.getmName(self.p3),'Mohsen')
def test_display(self):
rtn1=self.p3.display()
self.assertEqual(rtn1,0)
rtn1=self.p1.display()
self.assertEqual(rtn1,0)
def test_User(self):
p1 = patient.Patient('12e', 'pass1', 'Mr.','Rajeev', 'Ranjan', 'Roy')
self.assertNotIsInstance(p1.id, int)
#unittest.main(argv=[''], verbosity=2, exit=False)