|
@@ -73,6 +73,10 @@ def test_set_values_with_final_list_index_key_adds_it_to_config():
|
|
|
|
|
|
|
|
|
def test_type_for_option_with_option_finds_type():
|
|
|
+ flexmock(module.borgmatic.config.schema).should_receive('get_properties').replace_with(
|
|
|
+ lambda sub_schema: sub_schema['properties']
|
|
|
+ )
|
|
|
+
|
|
|
assert (
|
|
|
module.type_for_option(
|
|
|
schema={'type': 'object', 'properties': {'foo': {'type': 'integer'}}},
|
|
@@ -83,6 +87,10 @@ def test_type_for_option_with_option_finds_type():
|
|
|
|
|
|
|
|
|
def test_type_for_option_with_nested_option_finds_type():
|
|
|
+ flexmock(module.borgmatic.config.schema).should_receive('get_properties').replace_with(
|
|
|
+ lambda sub_schema: sub_schema['properties']
|
|
|
+ )
|
|
|
+
|
|
|
assert (
|
|
|
module.type_for_option(
|
|
|
schema={
|
|
@@ -98,6 +106,10 @@ def test_type_for_option_with_nested_option_finds_type():
|
|
|
|
|
|
|
|
|
def test_type_for_option_with_missing_nested_option_finds_nothing():
|
|
|
+ flexmock(module.borgmatic.config.schema).should_receive('get_properties').replace_with(
|
|
|
+ lambda sub_schema: sub_schema['properties']
|
|
|
+ )
|
|
|
+
|
|
|
assert (
|
|
|
module.type_for_option(
|
|
|
schema={
|
|
@@ -113,6 +125,10 @@ def test_type_for_option_with_missing_nested_option_finds_nothing():
|
|
|
|
|
|
|
|
|
def test_type_for_option_with_typeless_nested_option_finds_nothing():
|
|
|
+ flexmock(module.borgmatic.config.schema).should_receive('get_properties').replace_with(
|
|
|
+ lambda sub_schema: sub_schema['properties']
|
|
|
+ )
|
|
|
+
|
|
|
assert (
|
|
|
module.type_for_option(
|
|
|
schema={
|
|
@@ -125,7 +141,11 @@ def test_type_for_option_with_typeless_nested_option_finds_nothing():
|
|
|
)
|
|
|
|
|
|
|
|
|
-def test_type_for_list_index_option_finds_type():
|
|
|
+def test_type_for_option_with_list_index_option_finds_type():
|
|
|
+ flexmock(module.borgmatic.config.schema).should_receive('get_properties').replace_with(
|
|
|
+ lambda sub_schema: sub_schema['properties']
|
|
|
+ )
|
|
|
+
|
|
|
assert (
|
|
|
module.type_for_option(
|
|
|
schema={
|
|
@@ -138,7 +158,11 @@ def test_type_for_list_index_option_finds_type():
|
|
|
)
|
|
|
|
|
|
|
|
|
-def test_type_for_nested_list_index_option_finds_type():
|
|
|
+def test_type_for_option_with_nested_list_index_option_finds_type():
|
|
|
+ flexmock(module.borgmatic.config.schema).should_receive('get_properties').replace_with(
|
|
|
+ lambda sub_schema: sub_schema['properties']
|
|
|
+ )
|
|
|
+
|
|
|
assert (
|
|
|
module.type_for_option(
|
|
|
schema={
|