| Total Complexity | 2 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | """This module contains the function that test the |
||
| 2 | peak_detection_fxn() function. It calls the core.py |
||
| 3 | file which contains the function to be tested.""" |
||
| 4 | |||
| 5 | import numpy as np |
||
| 6 | import core |
||
| 7 | |||
| 8 | def test_peak_detection_fxn(): |
||
| 9 | """This function tests the peak_detection_fxn() function.""" |
||
| 10 | read_file = core.read_file('../data/10mM_2,7-AQDS_1M_KOH_25mVs_0.5step_2.txt') |
||
| 11 | file_df = core.data_frame(read_file, 2) |
||
| 12 | y_column = file_df['Current'] |
||
| 13 | df2 = core.peak_detection_fxn(y_column) |
||
| 14 | |||
| 15 | # check that the output is a list |
||
| 16 | assert isinstance(df2, list) |
||
| 17 | |||
| 18 | # check that there are two outputs |
||
| 19 | assert (len(df2)) == 2 |
||
| 20 | |||
| 21 | # check if the outputs are integer values |
||
| 22 | for i in range(len(df2)): |
||
| 23 | assert isinstance(df2[i], np.int32) |
||
| 24 |