@@ -33,12 +33,14 @@ def test_slicer_init():
33
33
assert isinstance (s .slider , dcc .Slider )
34
34
assert isinstance (s .stores , list )
35
35
assert all (isinstance (store , (dcc .Store , dcc .Interval )) for store in s .stores )
36
+ for store in [s .clim , s .state , s .extra_traces , s .overlay_data ]:
37
+ assert isinstance (store , dcc .Store )
36
38
37
39
38
40
def test_slicer_thumbnail ():
39
- app = dash .Dash ()
40
41
vol = np .random .uniform (0 , 255 , (100 , 100 , 100 )).astype (np .uint8 )
41
42
43
+ app = dash .Dash ()
42
44
_ = VolumeSlicer (app , vol )
43
45
# Test for name pattern of server-side callback when thumbnails are used
44
46
assert any (["server-data.data" in key for key in app .callback_map ])
@@ -49,6 +51,21 @@ def test_slicer_thumbnail():
49
51
assert not any (["server-data.data" in key for key in app .callback_map ])
50
52
51
53
54
+ def test_clim ():
55
+ app = dash .Dash ()
56
+ vol = np .random .uniform (0 , 255 , (10 , 10 , 10 )).astype (np .uint8 )
57
+ mi , ma = vol .min (), vol .max ()
58
+
59
+ s = VolumeSlicer (app , vol )
60
+ assert s ._initial_clim == (mi , ma )
61
+
62
+ s = VolumeSlicer (app , vol , clim = None )
63
+ assert s ._initial_clim == (mi , ma )
64
+
65
+ s = VolumeSlicer (app , vol , clim = (10 , 12 ))
66
+ assert s ._initial_clim == (10 , 12 )
67
+
68
+
52
69
def test_scene_id_and_context_id ():
53
70
app = dash .Dash ()
54
71
0 commit comments