Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ RUN pip install scipy && \
conda clean -i -l -t -y && \
rm -rf /usr/local/src/*


# xvfbwrapper with dependencies
RUN apt-get install -y xvfb && \
pip install xvfbwrapper && \
# ~~~~ CLEAN UP ~~~~
rm -rf /root/.cache/pip/* && \
apt-get autoremove -y && apt-get clean


RUN pip install --upgrade mpld3 && \
pip install mplleaflet && \
pip install gpxpy && \
Expand Down
19 changes: 19 additions & 0 deletions tests/test_dipy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import unittest
import os.path
from dipy.viz import window
from xvfbwrapper import Xvfb

class TestDipy(unittest.TestCase):
out_file = 'test.png'
def test_renderer(self):
vdisplay = Xvfb()
vdisplay.start()

ren = window.Renderer()
window.record(ren, n_frames=1, out_path=self.out_file, size=(600, 600))
self.assertTrue(os.path.exists(self.out_file))

vdisplay.stop()

def tearDown(self):
os.remove(self.out_file)
11 changes: 11 additions & 0 deletions tests/test_xvfbwrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import unittest
import os.path
from xvfbwrapper import Xvfb

class TestXvfbwrapper(unittest.TestCase):
def test_xvfb(self):
vdisplay = Xvfb()
vdisplay.start()
display_var = ':{}'.format(vdisplay.new_display)
self.assertEqual(display_var, os.environ['DISPLAY'])
vdisplay.stop()