-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperformance_test.py
56 lines (39 loc) · 1.34 KB
/
performance_test.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
#!/bin/python3
import pytest
import const
import os
from quality import exportQualityResult
from results_structure import checkFiles, cleanOldData
from performance import exportPerformanceResult, getExpSettings
const.SERVICES_NUM = [10]
const.SDS_NUM = [10]
@pytest.mark.parametrize("f", ['./.experiements_test'])
def test_exportPerformanceResult(f):
"""
Check that the function creates the right number of files
"""
fileCount = 0
totalFile = 2
checkFiles(f)
exportQualityResult(True, f)
exportPerformanceResult(f)
for d in os.listdir(f'{f}/performance'):
for d2 in os.listdir(f'{f}/performance/{d}'):
fileCount += 1
assert fileCount == totalFile
cleanOldData(f)
for d in os.listdir(f'{f}/quality'):
for d2 in os.listdir(f'{f}/quality/{d}'):
if os.path.isdir(f'{f}/quality/{d}/{d2}'):
for d3 in os.listdir(f'{f}/quality/{d}/{d2}'):
os.rmdir(f'{f}/quality/{d}/{d2}/{d3}')
os.rmdir(f'{f}/quality/{d}/{d2}')
os.rmdir(f'{f}/quality/{d}')
os.rmdir(f'{f}/quality')
for d in os.listdir(f'{f}/performance'):
os.rmdir(f'{f}/performance/{d}')
os.rmdir(f'{f}/performance')
for d in os.listdir(f'{f}/datasets'):
os.rmdir(f'{f}/datasets/{d}')
os.rmdir(f'{f}/datasets')
os.rmdir(f)