Skip to content

Commit 48b6a8f

Browse files
committed
added test cases; see #438
1 parent 292b59c commit 48b6a8f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test_unit_eval.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
"""Unit tests for Python interpreter."""
22

3+
from pytest_homeassistant_custom_component.common import MockConfigEntry
4+
35
from custom_components.pyscript.const import CONF_ALLOW_ALL_IMPORTS, CONFIG_ENTRY, DOMAIN
46
from custom_components.pyscript.eval import AstEval
57
from custom_components.pyscript.function import Function
68
from custom_components.pyscript.global_ctx import GlobalContext, GlobalContextMgr
79
from custom_components.pyscript.state import State
810
from custom_components.pyscript.trigger import TrigTime
9-
from pytest_homeassistant_custom_component.common import MockConfigEntry
1011

1112
evalTests = [
1213
["1", 1],
@@ -43,6 +44,10 @@
4344
["1 and True", True],
4445
["1 and False", False],
4546
["0 and False", 0],
47+
["None or 2", 2],
48+
["False or 3", 3],
49+
["None or 'xyz'", "xyz"],
50+
["False or 'xyz'", "xyz"],
4651
["0 or 1", 1],
4752
["0 or 0", 0],
4853
["0 or True", True],

0 commit comments

Comments
 (0)