summaryrefslogtreecommitdiffstats
path: root/tests/commands/validate_manifest_test.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-30 16:53:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-30 16:53:19 +0000
commit02d5100afa71d1343de4066b812cd4cdc774d812 (patch)
tree6bccae957398fab29aaa226fb0bd65f0c258a36a /tests/commands/validate_manifest_test.py
parentAdding upstream version 2.21.0. (diff)
downloadpre-commit-upstream/3.0.2.tar.xz
pre-commit-upstream/3.0.2.zip
Adding upstream version 3.0.2.upstream/3.0.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/commands/validate_manifest_test.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/commands/validate_manifest_test.py b/tests/commands/validate_manifest_test.py
new file mode 100644
index 0000000..a4bc8ac
--- /dev/null
+++ b/tests/commands/validate_manifest_test.py
@@ -0,0 +1,18 @@
+from __future__ import annotations
+
+from pre_commit.commands.validate_manifest import validate_manifest
+
+
+def test_validate_manifest_ok():
+ assert not validate_manifest(('.pre-commit-hooks.yaml',))
+
+
+def test_not_ok(tmpdir):
+ not_yaml = tmpdir.join('f.notyaml')
+ not_yaml.write('{')
+ not_schema = tmpdir.join('notconfig.yaml')
+ not_schema.write('{}')
+
+ assert validate_manifest(('does-not-exist',))
+ assert validate_manifest((not_yaml.strpath,))
+ assert validate_manifest((not_schema.strpath,))