+
+
+@pytest.mark.parametrize("content", [[], None])
+def test_flatten_config_list_empty(content):
+ assert flatten_config_list(content) == []
+
+
+@pytest.mark.parametrize("content", [{'foo': 'bar'}, 'hello world', 3])
+def test_flatten_config_list_no_list(content):
+ with pytest.raises(UsageError):
+ flatten_config_list(content)
+
+
+def test_flatten_config_list_allready_flat():
+ assert flatten_config_list([1, 2, 456]) == [1, 2, 456]
+
+
+def test_flatten_config_list_nested():
+ content = [
+ 34,
+ [{'first': '1st', 'second': '2nd'}, {}],
+ [[2, 3], [45, [56, 78], 66]],
+ 'end'
+ ]
+ assert flatten_config_list(content) == \
+ [34, {'first': '1st', 'second': '2nd'}, {},
+ 2, 3, 45, 56, 78, 66, 'end']