diff --git a/xvfbwrapper/test_xvfb.py b/xvfbwrapper/test_xvfb.py index eb9c746..3a8244d 100644 --- a/xvfbwrapper/test_xvfb.py +++ b/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__':