new syntax
This commit is contained in:
parent
8eeb9abe83
commit
54f882c6f5
2 changed files with 11 additions and 11 deletions
|
|
@ -42,8 +42,8 @@ def maybe_indent_override_values(value: str) -> List[str]:
|
|||
-------
|
||||
Value if it is an overide [Value]. None otherwise.
|
||||
"""
|
||||
if value.startswith("[") and value.endswith("]"):
|
||||
return value[1:-1].split("][")
|
||||
if value.startswith("=[") and value.endswith("]"):
|
||||
return value[2:-1].split("|")
|
||||
return []
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -98,9 +98,9 @@ def preset_with_subscription_value_nested_presets_and_indent_variables(
|
|||
preset_with_subscription_value,
|
||||
**{
|
||||
"parent_preset_2": {
|
||||
"[INDENT_1]": {
|
||||
"=[INDENT_1]": {
|
||||
"parent_preset_1": {"test_2_1": "is_2_1_overwritten"},
|
||||
"[INDENT_2]": {
|
||||
"=[INDENT_2]": {
|
||||
"test_1": "is_1_overwritten",
|
||||
},
|
||||
}
|
||||
|
|
@ -117,9 +117,9 @@ def preset_with_subscription_value_nested_presets_and_indent_variables_same_line
|
|||
preset_with_subscription_value,
|
||||
**{
|
||||
"parent_preset_2": {
|
||||
"[INDENT_1]": {
|
||||
"=[INDENT_1]": {
|
||||
"parent_preset_1": {"test_2_1": "is_2_1_overwritten"},
|
||||
"[INDENT_2][INDENT_3]": {
|
||||
"=[INDENT_2|INDENT_3]": {
|
||||
"test_1": "is_1_overwritten",
|
||||
},
|
||||
}
|
||||
|
|
@ -308,11 +308,11 @@ def test_subscription_file_bad_value(config_file: ConfigFile):
|
|||
|
||||
def test_subscription_file_using_value_when_not_defined(config_file: ConfigFile):
|
||||
with mock_load_yaml(
|
||||
preset_dict={"[INDENTS_IN_ERR_MSG]": {"sub_name": "single value, __value__ not defined"}}
|
||||
preset_dict={"=[INDENTS_IN_ERR_MSG]": {"sub_name": "single value, __value__ not defined"}}
|
||||
), pytest.raises(
|
||||
ValidationException,
|
||||
match=re.escape(
|
||||
"Validation error in [INDENTS_IN_ERR_MSG].sub_name: Subscription "
|
||||
"Validation error in =[INDENTS_IN_ERR_MSG].sub_name: Subscription "
|
||||
"sub_name is a string, but the subscription value is not set to an override variable"
|
||||
),
|
||||
):
|
||||
|
|
@ -322,14 +322,14 @@ def test_subscription_file_using_value_when_not_defined(config_file: ConfigFile)
|
|||
def test_subscription_file_using_conflicting_preset_name(config_file: ConfigFile):
|
||||
with mock_load_yaml(
|
||||
preset_dict={
|
||||
"[INDENTS_IN_ERR_MSG]": {
|
||||
"[ANOTHER]": {"jellyfin_tv_show_by_date": "single value, __value__ not defined"}
|
||||
"=[INDENTS_IN_ERR_MSG]": {
|
||||
"=[ANOTHER]": {"jellyfin_tv_show_by_date": "single value, __value__ not defined"}
|
||||
}
|
||||
}
|
||||
), pytest.raises(
|
||||
ValidationException,
|
||||
match=re.escape(
|
||||
"Validation error in [INDENTS_IN_ERR_MSG].[ANOTHER].jellyfin_tv_show_by_date: "
|
||||
"Validation error in =[INDENTS_IN_ERR_MSG].=[ANOTHER].jellyfin_tv_show_by_date: "
|
||||
"jellyfin_tv_show_by_date conflicts with an existing preset name and cannot be used "
|
||||
"as a subscription name"
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue