Skip to content

Commit 0c0c3fa

Browse files
authored
test: Add unit test for get_remote_function_locations (#2016)
1 parent 09b67da commit 0c0c3fa

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/unit/functions/test_remote_function_utils.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,25 @@
2121
from bigframes.functions import _utils, function_typing
2222

2323

24+
@pytest.mark.parametrize(
25+
("input_location", "expected_bq_location", "expected_cf_region"),
26+
[
27+
(None, "us", "us-central1"),
28+
("us", "us", "us-central1"),
29+
("eu", "eu", "europe-west1"),
30+
("US-east4", "us-east4", "us-east4"),
31+
],
32+
)
33+
def test_get_remote_function_locations(
34+
input_location, expected_bq_location, expected_cf_region
35+
):
36+
"""Tests getting remote function locations for various locations."""
37+
bq_location, cf_region = _utils.get_remote_function_locations(input_location)
38+
39+
assert bq_location == expected_bq_location
40+
assert cf_region == expected_cf_region
41+
42+
2443
def test_get_updated_package_requirements_no_extra_package():
2544
"""Tests with no extra package."""
2645
result = _utils.get_updated_package_requirements(capture_references=False)

0 commit comments

Comments
 (0)