-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_to_csv.py
32 lines (26 loc) · 998 Bytes
/
test_to_csv.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
import unittest
from model import *
import pandas as pd
class TestToCSVFuctions(unittest.TestCase):
def test_confusion_matrix(self):
# Arrange
model = YubiModel(15,126,np.array(['A', 'B', 'C', 'D', 'E', 'Idle']), os.path.join('MP_Data'), is_test = True)
confusion_matrix = [[[45, 1],
[1,8]],
[[2, 8],
[21, 9]],
[[84, 6],
[35, 4]],
[[15, 20],
[69, 420]],
[[22, 11],
[34, 85]],
[[78, 1],
[1,2]]]
previous = len(os.listdir(model.logs_path))
# Act
model.save_confusion_matrix(confusion_matrix)
# Assert
self.assertGreater(len(os.listdir(model.logs_path)), previous)
if __name__ == '__main__':
unittest.main()