Esempio n. 1
0
def test_not_too_sluggish_js_function(transpiled_file, selenium):
    start(selenium)
    eel.set_timeout_js(2)
    with eel.import_frontend_functions():
        from web.tests import sluggish
    val = sluggish(1.5)()
    assert val is True

    eel.set_timeout_js(1)
    with eel.import_frontend_functions():
        from web.tests import sluggish
    val = sluggish(0.5)()
    assert val is True
Esempio n. 2
0
def test_uncorrect_imports_front(transpiled_file):
    with pytest.raises(
            Exception,
            match=
            "You must write your imports under the form 'from x.y import z'"):
        with eel.import_frontend_functions():
            import web.imports.pong2

    with pytest.raises(
            Exception,
            match=
            "You must write your imports under the form 'from x.y import z'"):
        with eel.import_frontend_functions():
            import web.imports.pong2
Esempio n. 3
0
def test_too_sluggish_py_function(transpiled_file, selenium):
    start(selenium)
    eel.set_timeout_js(25)
    with eel.import_frontend_functions():
        from web.tests import call_a_sluggish_pythonfunction
    v = call_a_sluggish_pythonfunction(24)()
    assert v is True
Esempio n. 4
0
def test_correct_import_frontends_as(transpiled_file):
    try:
        with eel.import_frontend_functions():
            from web.imports.pong2 import pingball as pg
        pg(4)()
    except Exception as e:
        pytest.fail("should have been OK " + str(e))
    assert True
Esempio n. 5
0
def test_python_call_with_kwargs(transpiled_file, selenium):
    start(selenium)
    with eel.import_frontend_functions():
        from web.tests import aminusb
    v = aminusb(a=5, b=2)()
    assert v == 3

    v = aminusb(5, b=2)()
    assert v == 3

    v = aminusb(5, 2)()
    assert v == 3
Esempio n. 6
0
import eel_for_transcrypt as eel

with eel.import_frontend_functions():
    from web.anotherfrontend import biglogger
    

@eel.expose
def substract(a, b):
    val = a - b
    biglogger("this is something")
    biglogger(val)
    return val
Esempio n. 7
0
def transcrypt_generator(transpiled_file, selenium):
    with eel.import_frontend_functions():
        from web.tests import transcrypt_generator
    start(selenium)
    return transcrypt_generator
Esempio n. 8
0
def call_a_python_generator_from_js(transpiled_file, selenium):
    with eel.import_frontend_functions():
        from web.tests import call_a_python_generator_from_js
    start(selenium)
    return call_a_python_generator_from_js
Esempio n. 9
0
def identity_js(transpiled_file, selenium):
    with eel.import_frontend_functions():
        from web.tests import identity_js
    start(selenium)
    return identity_js
Esempio n. 10
0
def get_a_dataclass(transpiled_file, selenium):
    with eel.import_frontend_functions():
        from web.tests import get_a_dataclass
    start(selenium)
    return get_a_dataclass
Esempio n. 11
0
def build_send_getback_a_dataclass(transpiled_file, selenium):
    with eel.import_frontend_functions():
        from web.tests import build_send_getback_a_dataclass
    start(selenium)
    return build_send_getback_a_dataclass