From 494189435dc657ac681b17ff3498a21f5900689d Mon Sep 17 00:00:00 2001 From: "Stephen J. Fuhry" Date: Wed, 6 Jul 2016 22:28:48 -0400 Subject: [PATCH] add test for not exists in __init__ --- test_xvfb.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test_xvfb.py b/test_xvfb.py index 0bdae42..70f852d 100644 --- a/test_xvfb.py +++ b/test_xvfb.py @@ -19,6 +19,12 @@ def reset_display(self): def setUp(self): self.reset_display() + def test_xvfb_binary_not_exists(self): + with patch('xvfbwrapper.Xvfb.xvfb_exists') as xvfb_exists: + xvfb_exists.return_value = False + with self.assertRaises(EnvironmentError): + Xvfb() + def test_start(self): xvfb = Xvfb() self.addCleanup(xvfb.stop)