Skip to content

Commit

Permalink
test: add mds universe domain test for empty response (#1461)
Browse files Browse the repository at this point in the history
* chore: refresh sys test cred

* test: add mds universe domain test for empty response
  • Loading branch information
arithmetic1728 committed Jan 31, 2024
1 parent 6aeb700 commit 49a5ff7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
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

0 comments on commit 49a5ff7

Please sign in to comment.