This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch sbp
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
The following commit(s) were added to refs/heads/sbp by this push:
new be396bcc Add some more classification tests
be396bcc is described below
commit be396bcc53b74b5f7601a6ba65bb9d5cedfefce8
Author: Sean B. Palmer <[email protected]>
AuthorDate: Sun Mar 15 18:26:25 2026 +0000
Add some more classification tests
---
tests/unit/test_classify.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/tests/unit/test_classify.py b/tests/unit/test_classify.py
index 2bd61455..3ec7946a 100644
--- a/tests/unit/test_classify.py
+++ b/tests/unit/test_classify.py
@@ -20,6 +20,21 @@ import pathlib
import atr.classify as classify
+def test_archive_defaults_to_source():
+ path = pathlib.Path("apache-widget-1.0.tar.gz")
+ assert classify.classify(path) == classify.FileType.SOURCE
+
+
+def test_archive_tgz_defaults_to_source():
+ path = pathlib.Path("apache-widget-1.0.tgz")
+ assert classify.classify(path) == classify.FileType.SOURCE
+
+
+def test_archive_zip_defaults_to_source():
+ path = pathlib.Path("apache-widget-1.0.zip")
+ assert classify.classify(path) == classify.FileType.SOURCE
+
+
def test_binary_matcher_classifies_as_binary(tmp_path):
path = pathlib.Path("maven-mvnd-1.0.4-windows-amd64.zip")
result = classify.classify(path, base_path=tmp_path,
binary_matcher=_matches_windows)
@@ -48,6 +63,11 @@ def test_disallowed_files_detected():
assert classify.classify(path) == classify.FileType.DISALLOWED
+def test_jar_defaults_to_binary():
+ path = pathlib.Path("apache-widget-1.0.jar")
+ assert classify.classify(path) == classify.FileType.BINARY
+
+
def test_matchers_from_policy_builds_both(tmp_path):
source_matcher, binary_matcher =
classify.matchers_from_policy(["*-src.*"], ["*-bin.*"], tmp_path)
assert source_matcher is not None
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]