From 8b4d7124eff7c598021f2090310f3ec5dbcf0aae Mon Sep 17 00:00:00 2001 From: jialuo Date: Wed, 27 Aug 2025 00:07:52 +0000 Subject: [PATCH] test: Add unit test for get_bigframes_function_name --- .../functions/test_remote_function_utils.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/unit/functions/test_remote_function_utils.py b/tests/unit/functions/test_remote_function_utils.py index 687c599985..e46e04b427 100644 --- a/tests/unit/functions/test_remote_function_utils.py +++ b/tests/unit/functions/test_remote_function_utils.py @@ -76,6 +76,32 @@ def test_get_cloud_function_name(func_hash, session_id, uniq_suffix, expected_na assert result == expected_name +@pytest.mark.parametrize( + "function_hash, session_id, uniq_suffix, expected_name", + [ + ( + "hash123", + "session456", + None, + "bigframes_session456_hash123", + ), + ( + "hash789", + "sessionABC", + "suffixDEF", + "bigframes_sessionABC_hash789_suffixDEF", + ), + ], +) +def test_get_bigframes_function_name( + function_hash, session_id, uniq_suffix, expected_name +): + """Tests the construction of the BigQuery function name from its parts.""" + result = _utils.get_bigframes_function_name(function_hash, session_id, uniq_suffix) + + assert result == expected_name + + def test_get_updated_package_requirements_no_extra_package(): """Tests with no extra package.""" result = _utils.get_updated_package_requirements(capture_references=False)