From 9ae97edcdf11e5ed8f42eaf86e8de677ce0a83ca Mon Sep 17 00:00:00 2001 From: mathleur Date: Wed, 18 Sep 2024 14:33:13 +0100 Subject: [PATCH] fix tests --- tests/test_cyclic_axis_over_negative_vals.py | 40 ++++++------ tests/test_cyclic_axis_slicer_not_0.py | 40 ++++++------ tests/test_cyclic_axis_slicing.py | 66 ++++++++++---------- tests/test_cyclic_simple.py | 2 +- tests/test_cyclic_snapping.py | 6 +- 5 files changed, 77 insertions(+), 77 deletions(-) diff --git a/tests/test_cyclic_axis_over_negative_vals.py b/tests/test_cyclic_axis_over_negative_vals.py index 24d30b636..b95a044ff 100644 --- a/tests/test_cyclic_axis_over_negative_vals.py +++ b/tests/test_cyclic_axis_over_negative_vals.py @@ -40,7 +40,6 @@ def test_cyclic_float_axis_across_seam(self): result.pprint() assert len(result.leaves) == 1 assert [(val,) for val in result.leaves[0].values] == [ - (-0.2,), (-1.1,), (-1.0,), (-0.9,), @@ -50,6 +49,7 @@ def test_cyclic_float_axis_across_seam(self): (-0.5,), (-0.4,), (-0.3,), + (-0.2,), ] def test_cyclic_float_axis_inside_cyclic_range(self): @@ -93,31 +93,31 @@ def test_cyclic_float_axis_two_range_loops(self): result.pprint() assert len(result.leaves) == 1 assert [(val,) for val in result.leaves[0].values] == [ - (-0.7,), - (-0.6,), - (-0.5,), - (-0.4,), - (-0.3,), - (-0.2,), (-1.1,), - (-1.0,), - (-0.9,), - (-0.8,), - (-0.7,), - (-0.6,), - (-0.5,), - (-0.4,), - (-0.3,), - (-0.2,), (-1.1,), (-1.0,), + (-1.0,), (-0.9,), + (-0.9,), + (-0.8,), (-0.8,), (-0.7,), + (-0.7,), + (-0.7,), + (-0.6,), (-0.6,), + (-0.6,), + (-0.5,), (-0.5,), + (-0.5,), + (-0.4,), + (-0.4,), (-0.4,), (-0.3,), + (-0.3,), + (-0.3,), + (-0.2,), + (-0.2,), ] def test_cyclic_float_axis_below_axis_range(self): @@ -142,6 +142,10 @@ def test_cyclic_float_axis_below_axis_range_crossing_seam(self): # result.pprint() assert len(result.leaves) == 1 assert [(val,) for val in result.leaves[0].values] == [ + (-1.0,), + (-0.9,), + (-0.8,), + (-0.7,), (-0.7,), (-0.6,), (-0.5,), @@ -149,8 +153,4 @@ def test_cyclic_float_axis_below_axis_range_crossing_seam(self): (-0.3,), (-0.2,), (-0.1,), - (-1.0,), - (-0.9,), - (-0.8,), - (-0.7,), ] diff --git a/tests/test_cyclic_axis_slicer_not_0.py b/tests/test_cyclic_axis_slicer_not_0.py index 5a117c8e3..ec041263d 100644 --- a/tests/test_cyclic_axis_slicer_not_0.py +++ b/tests/test_cyclic_axis_slicer_not_0.py @@ -44,7 +44,6 @@ def test_cyclic_float_axis_across_seam(self): result.pprint() assert len(result.leaves) == 1 assert [(val,) for val in result.leaves[0].values] == [ - (-0.2,), (-1.1,), (-1.0,), (-0.9,), @@ -54,6 +53,7 @@ def test_cyclic_float_axis_across_seam(self): (-0.5,), (-0.4,), (-0.3,), + (-0.2,), ] def test_cyclic_float_axis_inside_cyclic_range(self): @@ -94,31 +94,31 @@ def test_cyclic_float_axis_two_range_loops(self): result = self.API.retrieve(request) assert len(result.leaves) == 1 assert [(val,) for val in result.leaves[0].values] == [ - (-0.7,), - (-0.6,), - (-0.5,), - (-0.4,), - (-0.3,), - (-0.2,), (-1.1,), - (-1.0,), - (-0.9,), - (-0.8,), - (-0.7,), - (-0.6,), - (-0.5,), - (-0.4,), - (-0.3,), - (-0.2,), (-1.1,), (-1.0,), + (-1.0,), (-0.9,), + (-0.9,), + (-0.8,), (-0.8,), (-0.7,), + (-0.7,), + (-0.7,), + (-0.6,), (-0.6,), + (-0.6,), + (-0.5,), (-0.5,), + (-0.5,), + (-0.4,), + (-0.4,), (-0.4,), (-0.3,), + (-0.3,), + (-0.3,), + (-0.2,), + (-0.2,), ] def test_cyclic_float_axis_below_axis_range(self): @@ -142,6 +142,10 @@ def test_cyclic_float_axis_below_axis_range_crossing_seam(self): result = self.API.retrieve(request) assert len(result.leaves) == 1 assert [(val,) for val in result.leaves[0].values] == [ + (-1.0,), + (-0.9,), + (-0.8,), + (-0.7,), (-0.7,), (-0.6,), (-0.5,), @@ -149,8 +153,4 @@ def test_cyclic_float_axis_below_axis_range_crossing_seam(self): (-0.3,), (-0.2,), (-0.1,), - (-1.0,), - (-0.9,), - (-0.8,), - (-0.7,), ] diff --git a/tests/test_cyclic_axis_slicing.py b/tests/test_cyclic_axis_slicing.py index 2ad154315..3bccf2801 100644 --- a/tests/test_cyclic_axis_slicing.py +++ b/tests/test_cyclic_axis_slicing.py @@ -44,9 +44,6 @@ def test_cyclic_float_axis_across_seam(self): assert len(result.leaves) == 1 result.pprint() assert [(val,) for val in result.leaves[0].values] == [ - (0.8,), - (0.9,), - (1.0,), (0.1,), (0.2,), (0.3,), @@ -54,6 +51,9 @@ def test_cyclic_float_axis_across_seam(self): (0.5,), (0.6,), (0.7,), + (0.8,), + (0.9,), + (1.0,), ] def test_cyclic_float_axis_across_seam_repeated(self): @@ -85,27 +85,27 @@ def test_cyclic_float_axis_across_seam_repeated_twice(self): result.pprint() assert len(result.leaves) == 1 assert [(val,) for val in result.leaves[0].values] == [ + (0.0,), (0.0,), (0.1,), - (0.2,), - (0.3,), - (0.4,), - (0.5,), - (0.6,), - (0.7,), - (0.8,), - (0.9,), - (1.0,), (0.1,), (0.2,), + (0.2,), (0.3,), + (0.3,), + (0.4,), (0.4,), (0.5,), + (0.5,), + (0.6,), (0.6,), (0.7,), + (0.7,), + (0.8,), (0.8,), (0.9,), - (0.0,), + (0.9,), + (1.0,), ] def test_cyclic_float_axis_inside_cyclic_range(self): @@ -151,31 +151,31 @@ def test_cyclic_float_axis_two_range_loops(self): # result.pprint() assert len(result.leaves) == 1 assert [(val,) for val in result.leaves[0].values] == [ - (0.3,), - (0.4,), - (0.5,), - (0.6,), - (0.7,), - (0.8,), - (0.9,), - (1.0,), + (0.0,), + (0.1,), (0.1,), (0.2,), + (0.2,), + (0.3,), (0.3,), + (0.3,), + (0.4,), (0.4,), + (0.4,), + (0.5,), (0.5,), + (0.5,), + (0.6,), (0.6,), + (0.6,), + (0.7,), (0.7,), + (0.7,), + (0.8,), (0.8,), (0.9,), - (0.0,), - (0.1,), - (0.2,), - (0.3,), - (0.4,), - (0.5,), - (0.6,), - (0.7,), + (0.9,), + (1.0,), ] def test_cyclic_float_axis_below_axis_range(self): @@ -201,6 +201,10 @@ def test_cyclic_float_axis_below_axis_range_crossing_seam(self): # result.pprint() assert len(result.leaves) == 1 assert [(val,) for val in result.leaves[0].values] == [ + (0.0,), + (0.1,), + (0.2,), + (0.3,), (0.3,), (0.4,), (0.5,), @@ -208,10 +212,6 @@ def test_cyclic_float_axis_below_axis_range_crossing_seam(self): (0.7,), (0.8,), (0.9,), - (0.0,), - (0.1,), - (0.2,), - (0.3,), ] def test_cyclic_float_axis_reversed(self): diff --git a/tests/test_cyclic_simple.py b/tests/test_cyclic_simple.py index d12e45413..9913872cc 100644 --- a/tests/test_cyclic_simple.py +++ b/tests/test_cyclic_simple.py @@ -43,7 +43,7 @@ def test_cyclic_float_axis_across_seam(self): result = self.API.retrieve(request) result.pprint() assert len(result.leaves) == 1 - assert [leaf.values for leaf in result.leaves] == [(0.9, 1.0, 0.1, 0.2)] + assert [leaf.values for leaf in result.leaves] == [(0.1, 0.2, 0.9, 1.0)] def test_cyclic_float_surrounding(self): request = Request( diff --git a/tests/test_cyclic_snapping.py b/tests/test_cyclic_snapping.py index f81c65405..ac149db2d 100644 --- a/tests/test_cyclic_snapping.py +++ b/tests/test_cyclic_snapping.py @@ -30,7 +30,7 @@ def test_cyclic_float_axis_across_seam(self): result = self.API.retrieve(request) result.pprint() assert len(result.leaves) == 1 - assert result.leaves[0].flatten()["long"] == (0.5, 0.0) + assert result.leaves[0].flatten()["long"] == (0.0, 0.5) assert result.leaves[0].result[0] is None - assert result.leaves[0].result[1][0] == 1 - assert result.leaves[0].result[1][1] == 0 + assert result.leaves[0].result[1][0] == 0 + assert result.leaves[0].result[1][1] == 1