aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_config_loader.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_config_loader.py')
-rw-r--r--tests/test_config_loader.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_config_loader.py b/tests/test_config_loader.py
new file mode 100644
index 0000000..c10e329
--- /dev/null
+++ b/tests/test_config_loader.py
@@ -0,0 +1,27 @@
+
+from pathlib import Path
+
+from onap_data_provider.config_loader import ConfigLoader
+
+
+def test_config_loader_no_dirs():
+ config_loader = ConfigLoader([Path(Path(__file__).parent, "test-data.yml")])
+ configs = list(config_loader.load())
+ assert len(configs) == 1
+
+ config_loader = ConfigLoader([Path(Path(__file__).parent, "test-data.yml"),
+ Path(Path(__file__).parent, "test-data-version.yml")])
+ configs = list(config_loader.load())
+ assert len(configs) == 2
+
+def test_config_loader_dir():
+ config_loader = ConfigLoader([Path(Path(__file__).parent, "config_dirs")])
+ configs = list(config_loader.load())
+ assert len(configs) == 2
+
+def test_config_loader_both_dirs_and_files():
+ config_loader = ConfigLoader([Path(Path(__file__).parent, "test-data.yml"),
+ Path(Path(__file__).parent, "test-data-version.yml"),
+ Path(Path(__file__).parent, "config_dirs")])
+ configs = list(config_loader.load())
+ assert len(configs) == 4