Skip to content

Commit 6bf06a7

Browse files
authored
test: Add unit test for get_bigframes_function_name (#2031)
1 parent cfa4b2a commit 6bf06a7

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/unit/functions/test_remote_function_utils.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,32 @@ def test_get_cloud_function_name(func_hash, session_id, uniq_suffix, expected_na
7676
assert result == expected_name
7777

7878

79+
@pytest.mark.parametrize(
80+
"function_hash, session_id, uniq_suffix, expected_name",
81+
[
82+
(
83+
"hash123",
84+
"session456",
85+
None,
86+
"bigframes_session456_hash123",
87+
),
88+
(
89+
"hash789",
90+
"sessionABC",
91+
"suffixDEF",
92+
"bigframes_sessionABC_hash789_suffixDEF",
93+
),
94+
],
95+
)
96+
def test_get_bigframes_function_name(
97+
function_hash, session_id, uniq_suffix, expected_name
98+
):
99+
"""Tests the construction of the BigQuery function name from its parts."""
100+
result = _utils.get_bigframes_function_name(function_hash, session_id, uniq_suffix)
101+
102+
assert result == expected_name
103+
104+
79105
def test_get_updated_package_requirements_no_extra_package():
80106
"""Tests with no extra package."""
81107
result = _utils.get_updated_package_requirements(capture_references=False)

0 commit comments

Comments
 (0)