| @@ 43-55 (lines=13) @@ | ||
| 40 | 0.001, decimal=3), "value incorrect for data") |
|
| 41 | ||
| 42 | ||
| 43 | def test_half_wave_potential(): |
|
| 44 | """This function tests half_wave_potential() function.""" |
|
| 45 | potentials = [0.500, 0.498, 0.499, 0.497] |
|
| 46 | currents = [7.040, 6.998, 8.256, 8.286] |
|
| 47 | potentials_d = pd.DataFrame(potentials) |
|
| 48 | currents_d = pd.DataFrame(currents) |
|
| 49 | ||
| 50 | assert (isinstance(calculations.half_wave_potential(potentials_d, currents_d) |
|
| 51 | == np.ndarray), "output is not an array") |
|
| 52 | assert (calculations.half_wave_potential(potentials_d, currents_d).size |
|
| 53 | == 1, "out not correct size") |
|
| 54 | (np.testing.assert_almost_equal(calculations.half_wave_potential(potentials_d, currents_d), |
|
| 55 | 0.0005, decimal=4), "value incorrect for data") |
|
| 56 | ||
| 57 | ||
| 58 | def test_peak_heights(): |
|
| @@ 36-46 (lines=11) @@ | ||
| 33 | return |
|
| 34 | ||
| 35 | ||
| 36 | def test_half_wave_potential(): |
|
| 37 | """This function tests half_wave_potential() function.""" |
|
| 38 | potentials = [0.500, 0.498, 0.499, 0.497] |
|
| 39 | currents = [7.040, 6.998, 8.256, 8.286] |
|
| 40 | potentials_d = pd.DataFrame(potentials) |
|
| 41 | currents_d = pd.DataFrame(currents) |
|
| 42 | ||
| 43 | assert type(calculations.half_wave_potential(potentials_d, currents_d)) == np.ndarray, "output is not an array" |
|
| 44 | assert calculations.half_wave_potential(potentials_d, currents_d).size == 1, "out not correct size" |
|
| 45 | np.testing.assert_almost_equal(calculations.half_wave_potential(potentials_d, currents_d), 0.0005, decimal=4), "value incorrect for data" |
|
| 46 | return |
|
| 47 | ||
| 48 | ||
| 49 | def test_peak_heights(): |
|