From d171d4b1ef8e0cf320d68c74207388d42055509e Mon Sep 17 00:00:00 2001
From: Felix Schindler <felix.schindler@wwu.de>
Date: Wed, 22 Jul 2020 22:22:47 +0200
Subject: [PATCH] [P] fix a bunch of tests

---
 python/dune/xt/test/grid_intersection.cc           |  2 +-
 python/dune/xt/test/grid_types.cc                  |  2 +-
 python/test/base.py                                | 11 ++++++-----
 python/test/{mpi.py => common_mpi.py}              |  0
 python/test/{constant.py => functions_constant.py} |  7 +++----
 python/test/grid_boundary_info.py                  |  8 ++++----
 python/test/grid_intersection.py                   |  2 +-
 python/test/{walker.py => grid_walker.py}          |  3 +--
 8 files changed, 17 insertions(+), 18 deletions(-)
 rename python/test/{mpi.py => common_mpi.py} (100%)
 rename python/test/{constant.py => functions_constant.py} (84%)
 rename python/test/{walker.py => grid_walker.py} (96%)

diff --git a/python/dune/xt/test/grid_intersection.cc b/python/dune/xt/test/grid_intersection.cc
index aaff77a14..e740d019e 100644
--- a/python/dune/xt/test/grid_intersection.cc
+++ b/python/dune/xt/test/grid_intersection.cc
@@ -26,7 +26,7 @@ PYBIND11_MODULE(_test_grid_intersection, m)
   using namespace pybind11::literals;
   using namespace Dune::XT;
 
-  using G = GRID_2D;
+  using G = YASP_2D_EQUIDISTANT_OFFSET;
   using I = Grid::extract_intersection_t<typename G::LeafGridView>;
 
   py::module::import("dune.xt.common");
diff --git a/python/dune/xt/test/grid_types.cc b/python/dune/xt/test/grid_types.cc
index 6e26b480a..9453a5dab 100644
--- a/python/dune/xt/test/grid_types.cc
+++ b/python/dune/xt/test/grid_types.cc
@@ -41,7 +41,7 @@ template <>
 void addbind_for_Grid<boost::tuples::null_type>(pybind11::module&, std::vector<std::string>&)
 {}
 
-PYBIND11_MODULE(_grid_types, m)
+PYBIND11_MODULE(_test_grid_types, m)
 {
   namespace py = pybind11;
 
diff --git a/python/test/base.py b/python/test/base.py
index bc3728f06..76725d38c 100644
--- a/python/test/base.py
+++ b/python/test/base.py
@@ -12,17 +12,18 @@
 # ~~~
 
 import pytest
-from dune.xt.test.base import load_all_submodule
-from dune.xt.test.grid_types import types
+from dune.xt.test import grid_types as types
 
 
 def test_load_all():
-    import dune.xt.grid as xtc
-    load_all_submodule(xtc)
+    import dune.xt.common
+    import dune.xt.la
+    import dune.xt.grid
+    import dune.xt.functions
 
 
 def test_empty():
-    from dune.xt.common._empty import Dog, Pet, Terrier
+    from dune.xt.common._common_empty import Dog, Pet, Terrier
 
     dog = Dog('Susi')
     pet = Pet('Bello')
diff --git a/python/test/mpi.py b/python/test/common_mpi.py
similarity index 100%
rename from python/test/mpi.py
rename to python/test/common_mpi.py
diff --git a/python/test/constant.py b/python/test/functions_constant.py
similarity index 84%
rename from python/test/constant.py
rename to python/test/functions_constant.py
index df494bd32..b848855f5 100644
--- a/python/test/constant.py
+++ b/python/test/functions_constant.py
@@ -12,12 +12,11 @@
 # ~~~
 
 import pytest
-import dune.xt.grid as xtg
 from dune.xt.test import grid_types as types
 import dune.xt.functions as xtf
 
 
-@pytest.fixture(params=xtg.types.available_types)
+@pytest.fixture(params=types.available_types)
 def function_provider(request):
     grid_type = request.param
     dim = 1
@@ -25,13 +24,13 @@ def function_provider(request):
         dim = 2
     if '3d' in grid_type:
         dim = 3
-    fn = "ConstantFunction__{}d_to_{}x{}".format(dim, 1, 1)
+    fn = "ConstantFunction{}To{}d".format(dim, 1)
     maker = getattr(xtf, fn)
     return maker([2], 'test_function')
 
 
 def test_available():
-    assert len(xtg.types.available_types) > 0
+    assert len(types.available_types) > 0
 
 
 def test_grid_provider(function_provider):
diff --git a/python/test/grid_boundary_info.py b/python/test/grid_boundary_info.py
index 6c8cb7de1..76b220a81 100644
--- a/python/test/grid_boundary_info.py
+++ b/python/test/grid_boundary_info.py
@@ -56,12 +56,12 @@ def test_initless_boundary_infos():
 
 
 def test_normalbased_boundary_inf():
-    from dune.xt.grid import NormalBaseBoundaryInfo
+    from dune.xt.grid import NormalBasedBoundaryInfo
     from dune.xt.grid import make_cube_grid, NoBoundary
     from grid_provider_cube import init_args as grid_init_args
     for args in grid_init_args:
         grid = make_cube_grid(*args)
-        NormalBaseBoundaryInfo(
+        NormalBasedBoundaryInfo(
             grid_provider=grid, default_boundary_type=NoBoundary(), tolerance=1e-10, logging_prefix='')
-        NormalBaseBoundaryInfo(grid_provider=grid, default_boundary_type=NoBoundary(), tolerance=1e-10)
-        NormalBaseBoundaryInfo(grid_provider=grid, default_boundary_type=NoBoundary())
+        NormalBasedBoundaryInfo(grid_provider=grid, default_boundary_type=NoBoundary(), tolerance=1e-10)
+        NormalBasedBoundaryInfo(grid_provider=grid, default_boundary_type=NoBoundary())
diff --git a/python/test/grid_intersection.py b/python/test/grid_intersection.py
index 1dfe21da0..82b89ec79 100644
--- a/python/test/grid_intersection.py
+++ b/python/test/grid_intersection.py
@@ -30,7 +30,7 @@ def test_boundary():
 
 def test_boundary_segment_index():
     grid = make_cube_grid(Dim(2), Cube(), [0, 0], [1, 1], [2, 2])
-    call_on_each_intersection(grid, lambda intersection: print(intersection.boundary_segment_index))
+    call_on_each_intersection(grid, lambda intersection: intersection.boundary and print(intersection.boundary_segment_index))
 
 
 def test_neighbor():
diff --git a/python/test/walker.py b/python/test/grid_walker.py
similarity index 96%
rename from python/test/walker.py
rename to python/test/grid_walker.py
index f4e487f22..4c387ff7f 100644
--- a/python/test/walker.py
+++ b/python/test/grid_walker.py
@@ -10,8 +10,7 @@
 #   Tobias Leibner (2018 - 2020)
 # ~~~
 
-from pymortests.base import runmodule
-
+from dune.xt.test.base import runmodule
 from dune.xt.grid import Dim, Cube, Simplex, make_cube_grid, Walker
 
 init_args = (
-- 
GitLab