Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions tests/unit/functions/test_remote_function_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,42 @@ def test_get_remote_function_locations(
assert cf_region == expected_cf_region


@pytest.mark.parametrize(
"func_hash, session_id, uniq_suffix, expected_name",
[
(
"hash123",
None,
None,
"bigframes-hash123",
),
(
"hash456",
"session789",
None,
"bigframes-session789-hash456",
),
(
"hash123",
None,
"suffixABC",
"bigframes-hash123-suffixABC",
),
(
"hash456",
"session789",
"suffixDEF",
"bigframes-session789-hash456-suffixDEF",
),
],
)
def test_get_cloud_function_name(func_hash, session_id, uniq_suffix, expected_name):
"""Tests the construction of the cloud function name from its parts."""
result = _utils.get_cloud_function_name(func_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)
Expand Down