How to use the pypom.interfaces.IDriver function in PyPOM

To help you get started, we’ve selected a few PyPOM examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla / PyPOM / tests / test_driver.py View on Github external
    @implementer(IFakeDriver2)
    class FakeDriver2:
        """ Another fake driver """

        def __init__(self, driver):
            self.driver = driver

    fake_driver = FakeDriver(None)
    fake_driver2 = FakeDriver2(None)

    registerDriver(IFakeDriver, FakeDriver)
    registerDriver(IFakeDriver2, IFakeDriver2)

    # driver implementation available after registerDriver
    adapted_driver = IDriver(fake_driver)
    adapted_driver2 = IDriver(fake_driver2)

    # same instance of adapted_driver
    assert isinstance(adapted_driver, FakeDriver)
    assert isinstance(adapted_driver2, FakeDriver2)
github mozilla / PyPOM / tests / test_driver.py View on Github external
    @implementer(IFakeDriver2)
    class FakeDriver2:
        """ Another fake driver """

        def __init__(self, driver):
            self.driver = driver

    fake_driver = FakeDriver(None)
    fake_driver2 = FakeDriver2(None)

    registerDriver(IFakeDriver, FakeDriver)
    registerDriver(IFakeDriver2, IFakeDriver2)

    # driver implementation available after registerDriver
    adapted_driver = IDriver(fake_driver)
    adapted_driver2 = IDriver(fake_driver2)

    # same instance of adapted_driver
    assert isinstance(adapted_driver, FakeDriver)
    assert isinstance(adapted_driver2, FakeDriver2)
github mozilla / PyPOM / tests / test_driver.py View on Github external
class FakeDriver:
        """ A fake driver """

        def __init__(self, driver):
            self.driver = driver

    fake_driver = FakeDriver(None)

    # no register driver, look up error
    with pytest.raises(TypeError):
        IDriver(fake_driver)

    registerDriver(IFakeDriver, FakeDriver)

    # driver implementation available after registerDriver
    adapted_driver = IDriver(fake_driver)

    # same instance of adapted_driver
    assert isinstance(adapted_driver, FakeDriver)
github mozilla / PyPOM / tests / test_driver.py View on Github external
class IFakeDriver(Interface):
        """ A fake marker interface"""

    class FakeDriver:
        """ A fake driver """

        def __init__(self, driver):
            self.driver = driver

    fake_driver = FakeDriver(None)

    registerDriver(IFakeDriver, FakeDriver, [FakeDriver])

    # driver implementation available after registerDriver
    adapted_driver = IDriver(fake_driver)

    # same instance of adapted_driver
    assert isinstance(adapted_driver, FakeDriver)
github mozilla / PyPOM / tests / test_driver.py View on Github external
class IFakeDriver(Interface):
        """ A fake marker interface"""

    @implementer(IFakeDriver)
    class FakeDriver:
        """ A fake driver """

        def __init__(self, driver):
            self.driver = driver

    fake_driver = FakeDriver(None)

    # no register driver, look up error
    with pytest.raises(TypeError):
        IDriver(fake_driver)

    registerDriver(IFakeDriver, FakeDriver)

    # driver implementation available after registerDriver
    adapted_driver = IDriver(fake_driver)

    # same instance of adapted_driver
    assert isinstance(adapted_driver, FakeDriver)

PyPOM

python page object model for selenium

MPL-2.0
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis