| @@ 7-23 (lines=17) @@ | ||
| 4 | from voltcycle import calculations |
|
| 5 | ||
| 6 | ||
| 7 | def test_peak_values(): |
|
| 8 | """This function tests peak_values() function.""" |
|
| 9 | potentials = [0.500, 0.499, 0.498, 0.497] |
|
| 10 | currents = [7.040, 6.998, 8.256, 8.286] |
|
| 11 | potentials_d = pd.DataFrame(potentials) |
|
| 12 | currents_d = pd.DataFrame(currents) |
|
| 13 | ||
| 14 | assert (isinstance(calculations.peak_values(potentials_d, currents_d), |
|
| 15 | np.ndarray), "output is not an array") |
|
| 16 | assert (calculations.peak_values(potentials_d, currents_d)[0] |
|
| 17 | == 0.498, "array value incorrect for data") |
|
| 18 | assert (calculations.peak_values(potentials_d, currents_d)[2] |
|
| 19 | == 0.499, "array value incorrect for data") |
|
| 20 | assert (calculations.peak_values(potentials_d, currents_d)[1] |
|
| 21 | == 8.256, "array value incorrect for data") |
|
| 22 | assert (calculations.peak_values(potentials_d, currents_d)[3] |
|
| 23 | == 6.998, "array value incorrect for data") |
|
| 24 | ||
| 25 | ||
| 26 | def test_del_potential(): |
|
| @@ 7-19 (lines=13) @@ | ||
| 4 | ||
| 5 | import calculations |
|
| 6 | ||
| 7 | def test_peak_values(): |
|
| 8 | """This function tests peak_values() function.""" |
|
| 9 | potentials = [0.500, 0.499, 0.498, 0.497] |
|
| 10 | currents = [7.040, 6.998, 8.256, 8.286] |
|
| 11 | potentials_d = pd.DataFrame(potentials) |
|
| 12 | currents_d = pd.DataFrame(currents) |
|
| 13 | ||
| 14 | assert type(calculations.peak_values(potentials_d, currents_d)) == np.ndarray, "output is not an array" |
|
| 15 | assert calculations.peak_values(potentials_d, currents_d)[0] == 0.498, "array value incorrect for data" |
|
| 16 | assert calculations.peak_values(potentials_d, currents_d)[2] == 0.499, "array value incorrect for data" |
|
| 17 | assert calculations.peak_values(potentials_d, currents_d)[1] == 8.256, "array value incorrect for data" |
|
| 18 | assert calculations.peak_values(potentials_d, currents_d)[3] == 6.998, "array value incorrect for data" |
|
| 19 | return |
|
| 20 | ||
| 21 | ||
| 22 | def test_del_potential(): |
|