Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 49a5ff7

Browse files
test: add mds universe domain test for empty response (#1461)
* chore: refresh sys test cred * test: add mds universe domain test for empty response
1 parent 6aeb700 commit 49a5ff7

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

system_tests/secrets.tar.enc

0 Bytes
Binary file not shown.

tests/compute_engine/test__metadata.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,19 @@ def test_get_universe_domain_success():
398398
assert universe_domain == "fake_universe_domain"
399399

400400

401+
def test_get_universe_domain_success_empty_response():
402+
request = make_request("", headers={"content-type": "text/plain"})
403+
404+
universe_domain = _metadata.get_universe_domain(request)
405+
406+
request.assert_called_once_with(
407+
method="GET",
408+
url=_metadata._METADATA_ROOT + "universe/universe_domain",
409+
headers=_metadata._METADATA_HEADERS,
410+
)
411+
assert universe_domain == "googleapis.com"
412+
413+
401414
def test_get_universe_domain_not_found():
402415
# Test that if the universe domain endpoint returns 404 error, we should
403416
# use googleapis.com as the universe domain

0 commit comments

Comments
 (0)