add test for not exists in __init__

This commit is contained in:
Stephen J. Fuhry 2016-07-06 22:28:48 -04:00
parent b4e8aac662
commit 494189435d
1 changed files with 6 additions and 0 deletions

View File

@ -19,6 +19,12 @@ class TestXvfb(unittest.TestCase):
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)