Skip to content

Commit

Permalink
added test cases; see #438
Browse files Browse the repository at this point in the history
  • Loading branch information
craigbarratt committed Feb 25, 2023
1 parent 292b59c commit 48b6a8f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_unit_eval.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"""Unit tests for Python interpreter."""

from pytest_homeassistant_custom_component.common import MockConfigEntry

from custom_components.pyscript.const import CONF_ALLOW_ALL_IMPORTS, CONFIG_ENTRY, DOMAIN
from custom_components.pyscript.eval import AstEval
from custom_components.pyscript.function import Function
from custom_components.pyscript.global_ctx import GlobalContext, GlobalContextMgr
from custom_components.pyscript.state import State
from custom_components.pyscript.trigger import TrigTime
from pytest_homeassistant_custom_component.common import MockConfigEntry

evalTests = [
["1", 1],
Expand Down Expand Up @@ -43,6 +44,10 @@
["1 and True", True],
["1 and False", False],
["0 and False", 0],
["None or 2", 2],
["False or 3", 3],
["None or 'xyz'", "xyz"],
["False or 'xyz'", "xyz"],
["0 or 1", 1],
["0 or 0", 0],
["0 or True", True],
Expand Down

0 comments on commit 48b6a8f

Please sign in to comment.