This is an automated email from the ASF dual-hosted git repository.
henry3260 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new fc996cf6347 Add tests for string utility edge cases (#72251)
fc996cf6347 is described below
commit fc996cf63477ef852d9f61305b57b649db2a0dbb
Author: Aaron Chen <[email protected]>
AuthorDate: Mon Sep 21 12:57:42 2026 -0700
Add tests for string utility edge cases (#72251)
---
airflow-core/tests/unit/utils/test_strings.py | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/airflow-core/tests/unit/utils/test_strings.py
b/airflow-core/tests/unit/utils/test_strings.py
index c18e5b3f7cd..153369507ca 100644
--- a/airflow-core/tests/unit/utils/test_strings.py
+++ b/airflow-core/tests/unit/utils/test_strings.py
@@ -19,7 +19,18 @@ from __future__ import annotations
import pytest
-from airflow.utils.strings import to_boolean
+from airflow.utils.strings import get_random_string, to_boolean
+
+
+def test_get_random_string_uses_requested_length_and_choices() -> None:
+ assert get_random_string(length=3, choices="a") == "aaa"
+
+
+def test_get_random_string_defaults_to_eight_alphanumeric_characters() -> None:
+ value = get_random_string()
+
+ assert len(value) == 8
+ assert value.isalnum()
@pytest.mark.parametrize(
@@ -35,3 +46,7 @@ from airflow.utils.strings import to_boolean
)
def test_to_boolean_strips_whitespace(input_string: str, expected_result:
bool) -> None:
assert to_boolean(input_string) is expected_result
+
+
+def test_to_boolean_returns_false_for_none() -> None:
+ assert to_boolean(None) is False