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
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
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
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
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
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
def transcrypt_generator(transpiled_file, selenium): with eel.import_frontend_functions(): from web.tests import transcrypt_generator start(selenium) return transcrypt_generator
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
def identity_js(transpiled_file, selenium): with eel.import_frontend_functions(): from web.tests import identity_js start(selenium) return identity_js
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
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