Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add mds universe domain test for empty response #1461

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file modified system_tests/secrets.tar.enc
Binary file not shown.
13 changes: 13 additions & 0 deletions tests/compute_engine/test__metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,19 @@ def test_get_universe_domain_success():
assert universe_domain == "fake_universe_domain"


def test_get_universe_domain_success_empty_response():
request = make_request("", headers={"content-type": "text/plain"})

universe_domain = _metadata.get_universe_domain(request)

request.assert_called_once_with(
method="GET",
url=_metadata._METADATA_ROOT + "universe/universe_domain",
headers=_metadata._METADATA_HEADERS,
)
assert universe_domain == "googleapis.com"


def test_get_universe_domain_not_found():
# Test that if the universe domain endpoint returns 404 error, we should
# use googleapis.com as the universe domain
Expand Down