Corey Morris
commited on
Commit
•
85667d0
1
Parent(s):
42ff7b9
Added initial tests. test_columns and test_rows will be updated or removed later as they test for the exact number of columns and rows. the number of rows will change as more models are added
Browse files- test_data_processing.py +29 -0
test_data_processing.py
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import unittest
|
2 |
+
from result_data_processor import ResultDataProcessor
|
3 |
+
import pandas as pd
|
4 |
+
|
5 |
+
class TestResultDataProcessor(unittest.TestCase):
|
6 |
+
|
7 |
+
def setUp(self):
|
8 |
+
self.processor = ResultDataProcessor()
|
9 |
+
|
10 |
+
# check that the result is a pandas dataframe
|
11 |
+
def test_process_data(self):
|
12 |
+
data = self.processor.data
|
13 |
+
self.assertIsInstance(data, pd.DataFrame)
|
14 |
+
|
15 |
+
# check that pandas dataframe has the right columns
|
16 |
+
def test_columns(self):
|
17 |
+
data = self.processor.data
|
18 |
+
self.assertIn('Parameters', data.columns)
|
19 |
+
self.assertIn('MMLU_average', data.columns)
|
20 |
+
# check number of columns
|
21 |
+
self.assertEqual(len(data.columns), 63)
|
22 |
+
|
23 |
+
# check that the number of rows is correct
|
24 |
+
def test_rows(self):
|
25 |
+
data = self.processor.data
|
26 |
+
self.assertEqual(len(data), 992)
|
27 |
+
|
28 |
+
if __name__ == '__main__':
|
29 |
+
unittest.main()
|