mirror of
https://github.com/divkit/divkit.git
synced 2026-05-07 20:02:32 +00:00
23 lines
384 B
Python
23 lines
384 B
Python
import pytest
|
|
from pydivkit.core import Expr
|
|
|
|
|
|
@pytest.mark.parametrize("input,res", (
|
|
("@{string}", Expr("@{string}")),
|
|
|
|
))
|
|
def test_expr(input, res):
|
|
assert str(Expr(input)) == str(res)
|
|
|
|
|
|
@pytest.mark.parametrize("input", (
|
|
"@{before",
|
|
"{before",
|
|
"after}",
|
|
"notcontains"
|
|
|
|
))
|
|
def test_expr_fail(input):
|
|
with pytest.raises(ValueError):
|
|
Expr(input)
|