File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -329,6 +329,20 @@ def test_get_success_custom_root_old_variable():
329329 timeout = _metadata ._METADATA_DEFAULT_TIMEOUT ,
330330 )
331331
332+ def test_get_success_custom_root ():
333+ request = make_request ("{}" , headers = {"content-type" : "application/json" })
334+
335+ fake_root = "http://another.metadata.service"
336+
337+ _metadata .get (request , PATH , root = fake_root )
338+
339+ request .assert_called_once_with (
340+ method = "GET" ,
341+ url = "{}/{}" .format (fake_root , PATH ),
342+ headers = _metadata ._METADATA_HEADERS ,
343+ timeout = _metadata ._METADATA_DEFAULT_TIMEOUT ,
344+ )
345+
332346
333347@mock .patch ("time.sleep" , return_value = None )
334348def test_get_failure (mock_sleep ):
Original file line number Diff line number Diff line change 1616#
1717
1818import mock
19- import pytest
19+ import pytest # type: ignore
2020
2121from google .auth import environment_vars , exceptions
2222from google .auth .compute_engine import _mtls
You can’t perform that action at this time.
0 commit comments