From 124ea791aa65901d1fd251694bc8658b742d1824 Mon Sep 17 00:00:00 2001 From: Mikhail Kiselyov Date: Wed, 15 Nov 2023 21:46:59 +0300 Subject: [PATCH] fix errors raised and better test readability --- octreelib/grid/grid_base.py | 2 +- test/grid/test_grid.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/octreelib/grid/grid_base.py b/octreelib/grid/grid_base.py index 5d567ca..f7eed7e 100644 --- a/octreelib/grid/grid_base.py +++ b/octreelib/grid/grid_base.py @@ -80,7 +80,7 @@ def __post_init__(self): ) if not issubclass(self.octree_type, OctreeBase): raise TypeError( - f"Cannot use the provided octree type {self.octree_manager_type.__name__}. " + f"Cannot use the provided octree type {self.octree_type.__name__}. " "It has to be a subclass of octree.OctreeBase." ) diff --git a/test/grid/test_grid.py b/test/grid/test_grid.py index 5df3325..61f923d 100644 --- a/test/grid/test_grid.py +++ b/test/grid/test_grid.py @@ -149,14 +149,14 @@ def test_invalid_octree_type(): try: Grid( GridConfig( - octree_manager_type=Octree, + octree_manager_type=type(None), octree_config=OctreeConfig(), voxel_edge_length=5, ) ) except TypeError as e: assert str(e) == ( - "Cannot use the provided octree manager type Octree. " + "Cannot use the provided octree manager type NoneType. " "It has to be a subclass of octree_manager.OctreeManager." ) else: @@ -168,14 +168,14 @@ def test_invalid_octree_type(): Grid( GridConfig( octree_manager_type=OctreeManager, - octree_type=OctreeManager, + octree_type=type(None), octree_config=OctreeConfig(), voxel_edge_length=5, ) ) except TypeError as e: assert str(e) == ( - "Cannot use the provided octree type OctreeManager. " + "Cannot use the provided octree type NoneType. " "It has to be a subclass of octree.OctreeBase." ) else: