aboutsummaryrefslogtreecommitdiffstats
path: root/library/recipes/docker_compose/test/ut/test_docker_context.py
diff options
context:
space:
mode:
authorvitalyisaev <vitalyisaev@ydb.tech>2023-11-30 13:26:22 +0300
committervitalyisaev <vitalyisaev@ydb.tech>2023-11-30 15:44:45 +0300
commit0a98fece5a9b54f16afeb3a94b3eb3105e9c3962 (patch)
tree291d72dbd7e9865399f668c84d11ed86fb190bbf /library/recipes/docker_compose/test/ut/test_docker_context.py
parentcb2c8d75065e5b3c47094067cb4aa407d4813298 (diff)
downloadydb-0a98fece5a9b54f16afeb3a94b3eb3105e9c3962.tar.gz
YQ Connector:Use docker-compose in integrational tests
Diffstat (limited to 'library/recipes/docker_compose/test/ut/test_docker_context.py')
-rw-r--r--library/recipes/docker_compose/test/ut/test_docker_context.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/library/recipes/docker_compose/test/ut/test_docker_context.py b/library/recipes/docker_compose/test/ut/test_docker_context.py
new file mode 100644
index 0000000000..2e8008afb6
--- /dev/null
+++ b/library/recipes/docker_compose/test/ut/test_docker_context.py
@@ -0,0 +1,31 @@
+import os
+import yaml
+import yatest.common
+
+import library.recipes.docker_compose.lib as lib
+
+
+def test_create_context():
+ root = yatest.common.work_path("context_root")
+ with open(yatest.common.test_source_path("context.yml")) as f:
+ ctx = yaml.safe_load(f)
+ context = lib._create_context(ctx, yatest.common.test_source_path("init_dir"), root)
+ assert "context1" in context
+ expected_context_paths = {
+ "context1": [
+ "init.txt",
+ "dir1/file3.txt",
+ "dir1/dir2/file4.txt",
+ "file1.txt",
+ "dir1/file2.txt",
+ "dir1/hello",
+ ],
+ "context2": [
+ "init.txt",
+ "file1.txt",
+ ]
+ }
+ for c, expected_paths in expected_context_paths.iteritems():
+ assert c in context
+ for p in expected_paths:
+ assert os.path.exists(os.path.join(root, c, p))