From d424960169122805482c4fe5de064220af658479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= <mueller.seb@posteo.de> Date: Sat, 4 May 2024 00:35:50 +0200 Subject: [PATCH] add tests for data location check --- tests/data/test_grid_spec.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/data/test_grid_spec.py b/tests/data/test_grid_spec.py index 814c5ed2..fe97d0b5 100644 --- a/tests/data/test_grid_spec.py +++ b/tests/data/test_grid_spec.py @@ -292,6 +292,16 @@ class TestGridSpec(unittest.TestCase): self.assertTrue(us_grid == cp_grid1) self.assertFalse(us_grid == cp_grid2) + def test_location_check(self): + grid_s1 = UniformGrid((2, 2), data_location="CELLS") + grid_s2 = UniformGrid((2, 2), data_location="POINTS") + grid_u1 = grid_s1.to_unstructured() + grid_u2 = grid_s2.to_unstructured() + self.assertTrue(grid_s1.compatible_with(grid_s2, check_location=False)) + self.assertFalse(grid_s1.compatible_with(grid_s2, check_location=True)) + self.assertTrue(grid_u1.compatible_with(grid_u2, check_location=False)) + self.assertFalse(grid_u1.compatible_with(grid_u2, check_location=True)) + def test_equality(self): grid1 = UniformGrid((2, 2), data_location=0) grid2 = UnstructuredGrid( -- GitLab