From 2b4487f42667c6572d6f86b56cac10690ce718da Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Mon, 13 Dec 2021 19:07:18 -0500 Subject: [PATCH] forgot to update test --- python/tests/test_Colormap.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/python/tests/test_Colormap.py b/python/tests/test_Colormap.py index d411ca39d..156907670 100644 --- a/python/tests/test_Colormap.py +++ b/python/tests/test_Colormap.py @@ -139,24 +139,16 @@ class TestColormap: c += c assert (np.allclose(c.colors[:len(c.colors)//2],c.colors[len(c.colors)//2:])) - @pytest.mark.parametrize('N,cmap,at,with_alpha,result',[ - (8,'gray',0.5,False,[0.5,0.5,0.5]), - (17,'gray',0.5,False,[0.5,0.5,0.5]), - (17,'gray',[0.5,0.75],False,[[0.5,0.5,0.5],[0.75,0.75,0.75]]), + @pytest.mark.parametrize('N,cmap,at,result',[ + (8,'gray',0.5,[0.5,0.5,0.5]), + (17,'gray',0.5,[0.5,0.5,0.5]), + (17,'gray',[0.5,0.75],[[0.5,0.5,0.5],[0.75,0.75,0.75]]), ]) - def test_at_value(self, N, cmap, at, with_alpha, result): - assert np.allclose(Colormap.from_predefined(cmap,N=N).at(at,with_alpha=with_alpha), + def test_at_value(self, N, cmap, at, result): + assert np.allclose(Colormap.from_predefined(cmap,N=N).at(at)[...,:3], result, rtol=0.005) - @pytest.mark.parametrize('N,cmap,at,with_alpha,result',[ - (8,'gray',0.5,False,'rgb(0.5,0.5,0.5)'), - (8,'gray',0.5,True,'rgba(0.5,0.5,0.5,1.0)'), - (8,'gray',[0.5,0.25],True,['rgba(0.5,0.5,0.5,1.0)','rgba(0.25,0.25,0.25,1.0)']), - ]) - def test_at_string(self, N, cmap, at, with_alpha, result): - assert np.all(Colormap.from_predefined(cmap,N=N).at(at,with_alpha=with_alpha,as_string=True) == result) - @pytest.mark.parametrize('bounds',[None,[2,10]]) def test_shade(self,ref_path,update,bounds): data = np.add(*np.indices((10, 11)))