def test_corsen(self):
        nc = 8
        h1 = np.random.rand(nc)*nc*0.5 + nc*0.5
        h2 = np.random.rand(nc)*nc*0.5 + nc*0.5
        h = [hi/np.sum(hi) for hi in [h1, h2]]  # normalize
        M = Mesh.TreeMesh(h)
        M._refineCell([0,0,0])
        M._refineCell([0,0,1])
        self.assertRaises(CellLookUpException, M._refineCell, [0,0,1])
        assert M._index([0,0,1]) not in M
        assert M._index([0,0,2]) in M
        assert M._index([2,0,2]) in M
        assert M._index([0,2,2]) in M
        assert M._index([2,2,2]) in M

        self.assertRaises(CellLookUpException, M._corsenCell, [0,0,1])
        M._corsenCell([0,0,2])
        assert M._index([0,0,1]) in M
        assert M._index([0,0,2]) not in M
        assert M._index([2,0,2]) not in M
        assert M._index([0,2,2]) not in M
        assert M._index([2,2,2]) not in M
        M._refineCell([0,0,1])

        self.assertRaises(CellLookUpException, M._corsenCell, [0,0,1])
        M._corsenCell([2,0,2])
        assert M._index([0,0,1]) in M
        assert M._index([0,0,2]) not in M
        assert M._index([2,0,2]) not in M
        assert M._index([0,2,2]) not in M
        assert M._index([2,2,2]) not in M
        M._refineCell([0,0,1])

        self.assertRaises(CellLookUpException, M._corsenCell, [0,0,1])
        M._corsenCell([0,2,2])
        assert M._index([0,0,1]) in M
        assert M._index([0,0,2]) not in M
        assert M._index([2,0,2]) not in M
        assert M._index([0,2,2]) not in M
        assert M._index([2,2,2]) not in M
        M._refineCell([0,0,1])

        self.assertRaises(CellLookUpException, M._corsenCell, [0,0,1])
        M._corsenCell([2,2,2])
        assert M._index([0,0,1]) in M
        assert M._index([0,0,2]) not in M
        assert M._index([2,0,2]) not in M
        assert M._index([0,2,2]) not in M
        assert M._index([2,2,2]) not in M
dataset/ETHPy150Open simpeg/simpeg/tests/mesh/test_TreeMesh.py/TestSimpleQuadTree.test_corsen/original