@@ -38,6 +38,7 @@ def test_notebook_alignment(renderer_notebook, brain_gc, nbexec):
38
38
def test_notebook_interactive (renderer_notebook , brain_gc , nbexec ):
39
39
"""Test interactive modes."""
40
40
import os
41
+ import tempfile
41
42
from contextlib import contextmanager
42
43
from numpy .testing import assert_allclose
43
44
from ipywidgets import Button
@@ -72,6 +73,11 @@ def interactive(on):
72
73
assert brain ._renderer .figure .notebook
73
74
assert brain ._renderer .figure .display is not None
74
75
brain ._renderer ._update ()
76
+ tmp_path = tempfile .mkdtemp ()
77
+ movie_path = os .path .join (tmp_path , 'test.gif' )
78
+ screenshot_path = os .path .join (tmp_path , 'test.png' )
79
+ brain ._renderer .actions ['movie_field' ].value = movie_path
80
+ brain ._renderer .actions ['screenshot_field' ].value = screenshot_path
75
81
total_number_of_buttons = sum (
76
82
'_field' not in k for k in brain ._renderer .actions .keys ())
77
83
number_of_buttons = 0
@@ -80,6 +86,8 @@ def interactive(on):
80
86
action .click ()
81
87
number_of_buttons += 1
82
88
assert number_of_buttons == total_number_of_buttons
89
+ assert os .path .isfile (movie_path )
90
+ assert os .path .isfile (screenshot_path )
83
91
img_nv = brain .screenshot ()
84
92
assert img_nv .shape == (300 , 300 , 3 ), img_nv .shape
85
93
img_v = brain .screenshot (time_viewer = True )
0 commit comments