Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbannon committed Apr 28, 2024
1 parent 17634da commit 414d333
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
1 change: 0 additions & 1 deletion tests/unit/config/test_config_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def test_partial_validate__incomplete_list_item(self, preset_dict):
"preset_dict",
[
{"overrides": "not a dict"},
{"overrides": {"nested": {"dict": "value"}}},
{"overrides": ["list"]},
],
)
Expand Down
24 changes: 22 additions & 2 deletions tests/unit/utils/test_script_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
from unit.script.conftest import single_variable_output

from ytdl_sub.script.parser import parse
from ytdl_sub.script.types.function import BuiltInFunction
from ytdl_sub.script.types.map import UnresolvedMap
from ytdl_sub.script.types.resolvable import String
from ytdl_sub.script.types.syntax_tree import SyntaxTree
from ytdl_sub.script.types.variable import Variable
from ytdl_sub.utils.script import ScriptUtils


Expand Down Expand Up @@ -57,5 +62,20 @@ def test_to_syntax_tree(self):
out = ScriptUtils.to_native_script(
{"{var_a}": "{var_b}", "static_a": "string with {var_c} in it"}
)
out2 = parse(out)
assert False
assert parse(out) == SyntaxTree(
ast=[
UnresolvedMap(
value={
Variable(name="var_a"): Variable(name="var_b"),
String(value="static_a"): BuiltInFunction(
name="concat",
args=[
BuiltInFunction(name="string", args=[String(value="string with ")]),
BuiltInFunction(name="string", args=[Variable(name="var_c")]),
BuiltInFunction(name="string", args=[String(value=" in it")]),
],
),
}
)
]
)

0 comments on commit 414d333

Please sign in to comment.