
* lift node version restraint to allow more recent version if already installed * add node test for latest version * change python version * use purple for debug logs * update workflow * add playwright dev dependency * update workflow * change test * oops * improve test * update test * fix tests * mv units tests to a subfolder * reorganize tests * fix install * update test_state * revert node changes and only keep new tests organization * move integration tests in tests/integration * fix integration workflow * fix dockerfile workflow * fix dockerfile workflow 2 * fix shared_state
22 lines
516 B
Python
22 lines
516 B
Python
from typing import Dict, List, Union
|
|
|
|
import pytest
|
|
|
|
from reflex.vars.base import figure_out_type
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
("value", "expected"),
|
|
[
|
|
(1, int),
|
|
(1.0, float),
|
|
("a", str),
|
|
([1, 2, 3], List[int]),
|
|
([1, 2.0, "a"], List[Union[int, float, str]]),
|
|
({"a": 1, "b": 2}, Dict[str, int]),
|
|
({"a": 1, 2: "b"}, Dict[Union[int, str], Union[str, int]]),
|
|
],
|
|
)
|
|
def test_figure_out_type(value, expected):
|
|
assert figure_out_type(value) == expected
|