added more unit tests
parent
347a7f3f2c
commit
a64f688375
|
@ -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…
Reference in New Issue