| @@ 26-40 (lines=15) @@ | ||
| 23 | == 6.998, "array value incorrect for data") |
|
| 24 | ||
| 25 | ||
| 26 | def test_del_potential(): |
|
| 27 | """This function tests the del_potential function.""" |
|
| 28 | potentials = [0.500, 0.498, 0.499, 0.497] |
|
| 29 | currents = [7.040, 6.998, 8.256, 8.286] |
|
| 30 | potentials_d = pd.DataFrame(potentials) |
|
| 31 | currents_d = pd.DataFrame(currents) |
|
| 32 | ||
| 33 | assert (isinstance(calculations.del_potential(potentials_d, currents_d) |
|
| 34 | == np.ndarray), "output is not an array") |
|
| 35 | assert (calculations.del_potential(potentials_d, currents_d).shape |
|
| 36 | == (1, 1), "output shape incorrect") |
|
| 37 | assert (calculations.del_potential(potentials_d, currents_d).size |
|
| 38 | == 1, "array size incorrect") |
|
| 39 | (np.testing.assert_almost_equal(calculations.del_potential(potentials_d, currents_d), |
|
| 40 | 0.001, decimal=3), "value incorrect for data") |
|
| 41 | ||
| 42 | ||
| 43 | def test_half_wave_potential(): |
|
| @@ 22-33 (lines=12) @@ | ||
| 19 | return |
|
| 20 | ||
| 21 | ||
| 22 | def test_del_potential(): |
|
| 23 | """This function tests the del_potential function.""" |
|
| 24 | potentials = [0.500, 0.498, 0.499, 0.497] |
|
| 25 | currents = [7.040, 6.998, 8.256, 8.286] |
|
| 26 | potentials_d = pd.DataFrame(potentials) |
|
| 27 | currents_d = pd.DataFrame(currents) |
|
| 28 | ||
| 29 | assert type(calculations.del_potential(potentials_d, currents_d)) == np.ndarray, "output is not an array" |
|
| 30 | assert calculations.del_potential(potentials_d, currents_d).shape == (1,), "output shape incorrect" |
|
| 31 | assert calculations.del_potential(potentials_d, currents_d).size == 1, "array size incorrect" |
|
| 32 | np.testing.assert_almost_equal(calculations.del_potential(potentials_d, currents_d), 0.001, decimal=3), "value incorrect for data" |
|
| 33 | return |
|
| 34 | ||
| 35 | ||
| 36 | def test_half_wave_potential(): |
|