Esempio n. 1
0
def test_verify_options(filedir):
    args = Namespace(binary='invalid/path')
    parser = ArgumentParser()

    with pytest.raises(SystemExit):
        verify_options(parser, args)

    args.binary = os.path.join(filedir, 'fake_binary.exe')
    verify_options(parser, args)  # assert no exception
Esempio n. 2
0
def test_verify_options(filedir):
    args = Namespace(app='firefox',
                     binary='invalid/path',
                     gecko_profile='False',
                     page_cycles=1,
                     page_timeout=60000)
    parser = ArgumentParser()

    with pytest.raises(SystemExit):
        verify_options(parser, args)

    args.binary = os.path.join(filedir, 'fake_binary.exe')
    verify_options(parser, args)  # assert no exception
Esempio n. 3
0
def test_verify_options(filedir):
    args = Namespace(app='firefox',
                     binary='invalid/path',
                     gecko_profile='False',
                     page_cycles=1,
                     page_timeout=60000)
    parser = ArgumentParser()

    with pytest.raises(SystemExit):
        verify_options(parser, args)

    args.binary = os.path.join(filedir, 'fake_binary.exe')
    verify_options(parser, args)  # assert no exception

    args = Namespace(app='geckoview',
                     binary='org.mozilla.geckoview_example',
                     gecko_profile='False',
                     is_release_build=False,
                     host='sophie')
    verify_options(parser, args)  # assert no exception
Esempio n. 4
0
def test_verify_options(filedir):
    args = Namespace(app='firefox',
                     binary='invalid/path',
                     gecko_profile='False',
                     page_cycles=1,
                     page_timeout=60000,
                     debug='True',
                     power_test=False,
                     memory_test=False)
    parser = ArgumentParser()

    with pytest.raises(SystemExit):
        verify_options(parser, args)

    args.binary = os.path.join(filedir, 'fake_binary.exe')
    verify_options(parser, args)  # assert no exception

    args = Namespace(app='geckoview',
                     binary='org.mozilla.geckoview_example',
                     activity='GeckoViewActivity',
                     intent='android.intent.action.MAIN',
                     gecko_profile='False',
                     is_release_build=False,
                     host='sophie',
                     power_test=False,
                     memory_test=False)
    verify_options(parser, args)  # assert no exception

    args = Namespace(app='refbrow',
                     binary='org.mozilla.reference.browser',
                     activity='BrowserTestActivity',
                     intent='android.intent.action.MAIN',
                     gecko_profile='False',
                     is_release_build=False,
                     host='sophie',
                     power_test=False,
                     memory_test=False)
    verify_options(parser, args)  # assert no exception

    args = Namespace(app='fenix',
                     binary='org.mozilla.fenix.browser',
                     activity='BrowserTestActivity',
                     intent='android.intent.action.VIEW',
                     gecko_profile='False',
                     is_release_build=False,
                     host='sophie',
                     power_test=False,
                     memory_test=False)
    verify_options(parser, args)  # assert no exception

    args = Namespace(app='refbrow',
                     binary='org.mozilla.reference.browser',
                     activity=None,
                     intent='android.intent.action.MAIN',
                     gecko_profile='False',
                     is_release_build=False,
                     host='sophie',
                     power_test=False,
                     memory_test=False)
    parser = ArgumentParser()

    verify_options(parser, args)  # also will work as uses default activity