summaryrefslogtreecommitdiffstats
path: root/tests/plugin_tests/grantlee_test.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 16:23:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 16:23:19 +0000
commit3554c1d4ae60c53c0232d05454ff853dc537096b (patch)
tree9f528439859090d3800a85fc43d13b8bf53bf451 /tests/plugin_tests/grantlee_test.py
parentAdding debian version 0.1.32. (diff)
downloaddebputy-3554c1d4ae60c53c0232d05454ff853dc537096b.tar.xz
debputy-3554c1d4ae60c53c0232d05454ff853dc537096b.zip
Merging upstream version 0.1.33.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/plugin_tests/grantlee_test.py')
-rw-r--r--tests/plugin_tests/grantlee_test.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/plugin_tests/grantlee_test.py b/tests/plugin_tests/grantlee_test.py
new file mode 100644
index 0000000..2cbcd2c
--- /dev/null
+++ b/tests/plugin_tests/grantlee_test.py
@@ -0,0 +1,34 @@
+from debputy.plugin.api.test_api import (
+ initialize_plugin_under_test,
+ build_virtual_file_system,
+ package_metadata_context,
+)
+
+
+def test_grantlee_dependencies(amd64_dpkg_architecture_variables) -> None:
+ plugin = initialize_plugin_under_test()
+ fs = build_virtual_file_system([])
+ context = package_metadata_context(package_fields={"Architecture": "all"})
+ metadata = plugin.run_metadata_detector("detect-grantlee-dependencies", fs, context)
+ assert "grantlee:Depends" not in metadata.substvars
+
+ context = package_metadata_context(
+ package_fields={"Architecture": "any"},
+ host_arch=amd64_dpkg_architecture_variables.current_host_arch,
+ )
+ madir = amd64_dpkg_architecture_variables.current_host_multiarch
+ fs = build_virtual_file_system(
+ [
+ f"usr/lib/{madir}/grantlee/random-dir",
+ ]
+ )
+ metadata = plugin.run_metadata_detector("detect-grantlee-dependencies", fs, context)
+ assert "grantlee:Depends" not in metadata.substvars
+
+ fs = build_virtual_file_system(
+ [
+ f"usr/lib/{madir}/grantlee/5.0/foo.so",
+ ]
+ )
+ metadata = plugin.run_metadata_detector("detect-grantlee-dependencies", fs, context)
+ assert metadata.substvars["grantlee:Depends"] == "grantlee5-templates-5-0"