|
4 | 4 |
|
5 | 5 | # Define test parameters
|
6 | 6 | params1 = [
|
7 |
| - ([0.5, 3, 1, {(0.0, -0.5), (0.0, 0.0), (-0.5, 0.0), (0.5, 0.0), (0.0, 0.5)}, 5]), |
8 |
| - ([1, 4, 1, {(-0.333333, -0.333333), (0.333333, -0.333333), (-0.333333, 0.333333), (0.333333, 0.333333)}, 4]), |
| 7 | + ([0.5, 3, 1], {(0.0, -0.5), (0.0, 0.0), (0.5, 0.0), (-0.5, 0.0), (0.0, 0.5)}), |
| 8 | + ([1, 4, 1], {(-0.333333, -0.333333), (0.333333, -0.333333), (-0.333333, 0.333333), (0.333333, 0.333333)}), |
9 | 9 | ]
|
10 | 10 |
|
11 | 11 |
|
12 | 12 | # Define the test function
|
13 |
| -@pytest.mark.parametrize("params1", params1) |
14 |
| -def test_get_grid_points(params1): |
15 |
| - radius, n_points_on_diameter, mu, expected_grid, expected_total_points = params1 |
| 13 | +@pytest.mark.parametrize("inputs, expected", params1) |
| 14 | +def test_get_grid_points(inputs, expected): |
| 15 | + expected_grid = expected |
| 16 | + actual_gs = Gridded_circle(radius=inputs[0], n_points_on_diameter=inputs[1], mu=inputs[2]) |
| 17 | + assert actual_gs.grid == expected_grid |
16 | 18 |
|
17 |
| - # Perform the test |
18 |
| - actual_gs = Gridded_circle(radius=radius, n_points_on_diameter=n_points_on_diameter, mu=mu) |
19 | 19 |
|
20 |
| - # Sort both sets of points to compare |
21 |
| - actual_grid_sorted = sorted(actual_gs.grid) |
22 |
| - expected_grid_sorted = sorted(expected_grid) |
23 |
| - |
24 |
| - # Assertions |
25 |
| - assert actual_gs.total_points_in_grid == expected_total_points |
26 |
| - for actual_point, expected_point in zip(actual_grid_sorted, expected_grid_sorted): |
27 |
| - assert actual_point == pytest.approx(expected_point, rel=1e-4, abs=1e-6) |
| 20 | +# assert actual_gs.grid == pytest.approx(expected_grid) |
| 21 | +# for actual_point, expected_point in zip(actual_grid_sorted, expected_grid_sorted): |
| 22 | +# assert actual_point == pytest.approx(expected_point, rel=1e-4, abs=1e-6) |
0 commit comments