Browse Source

added more unit tests

changes/49/376949/1
Corey Goldberg 9 years ago
parent
commit
a64f688375
  1. 14
      xvfbwrapper/test_xvfb.py

14
xvfbwrapper/test_xvfb.py

@ -16,13 +16,25 @@ class TestXvfb(unittest.TestCase):
self.assertEqual(':%d' % xvfb.vdisplay_num, os.environ['DISPLAY'])
self.assertIsNot(None, xvfb.proc)
def test_start_with_args(self):
w = 800
h = 600
depth = 16
xvfb = Xvfb(width=w, height=h, colordepth=depth)
xvfb.start()
self.assertEqual(w, xvfb.width)
self.assertEqual(h, xvfb.height)
self.assertEqual(depth, xvfb.colordepth)
self.assertEqual(os.environ['DISPLAY'], ':%d' % xvfb.vdisplay_num)
self.assertIsNot(None, xvfb.proc)
def test_stop(self):
orig = os.environ['DISPLAY']
xvfb = Xvfb()
xvfb.start()
self.assertNotEqual(orig, os.environ['DISPLAY'])
xvfb.stop()
self.assertEquals(orig, os.environ['DISPLAY'])
self.assertEqual(orig, os.environ['DISPLAY'])
if __name__ == '__main__':

Loading…
Cancel
Save