Skip to content

Commit

Permalink
Parameterise python marionette test_invalid_binary
Browse files Browse the repository at this point in the history
  • Loading branch information
davehunt committed Oct 21, 2016
1 parent d851f4c commit fe594a6
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions py/test/selenium/webdriver/marionette/mn_binary_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,18 @@

import pytest

from selenium.webdriver import Firefox
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary


class TestMarionetteBinary(object):
@pytest.fixture(params=['foo', FirefoxBinary(firefox_path='foo')],
ids=['string', 'binary'])
def driver_kwargs(request, driver_kwargs):
driver_kwargs['firefox_binary'] = request.param
return driver_kwargs

def test_invalid_binary_str(self, capabilities):
with pytest.raises(WebDriverException) as excinfo:
Firefox(capabilities=capabilities, firefox_binary='foo')
assert 'entity not found' in str(excinfo.value)

def test_invalid_binary_obj(self, capabilities):
with pytest.raises(WebDriverException) as excinfo:
binary = FirefoxBinary(firefox_path='foo')
Firefox(capabilities=capabilities, firefox_binary=binary)
assert 'entity not found' in str(excinfo.value)
def test_invalid_binary(driver_class, driver_kwargs):
with pytest.raises(WebDriverException) as excinfo:
driver_class(**driver_kwargs)
assert 'entity not found' in str(excinfo.value)

0 comments on commit fe594a6

Please sign in to comment.