-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathtest_app.py
More file actions
48 lines (35 loc) · 1.36 KB
/
test_app.py
File metadata and controls
48 lines (35 loc) · 1.36 KB
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
import unittest
#from Chapter01 import serial_test,multiprocessing_test,multithreading_test
class TestApp(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
# def test_00_serial(self):
# response = serial_test.serial_test()
# self.assertEqual(response, True)
#
# def test_01_multithreading(self):
# response = multithreading_test.multithreading_test()
# self.assertEqual(response, True)
#
# def test_02_multiprocessing(self):
# response = multiprocessing_test.multiprocessing_test()
# self.assertEqual(response, True)
def test_02_rolly_113040087(self):
from Chapter02.Rolly113040087 import main
response = main()
self.assertEqual(response, True)
def readfile(self,namafile):
f = open(namafile, "r")
return int(f.read())
def test_03_rollyDua113040087(self):
from Chapter02.rollyDua113040087 import rollyDua113040087,rollySemaphoreDeleteFile
threaddelete= rollySemaphoreDeleteFile("Thread Delete File ", 1,'anu')
threadutama = rollyDua113040087("Thread Utama ", 2,5,5,'anu')
threaddelete.start()
threadutama.start()
threaddelete.join()
threadutama.join()
respon=self.readfile('./Chapter02/anu.croot')
self.assertGreaterEqual(respon, 0)