mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-28 21:31:26 -07:00
Gcp auth deprecation (#44866)
This commit is contained in:
parent
a0d7d4b82f
commit
3550f342e0
2 changed files with 10 additions and 15 deletions
|
@ -151,16 +151,16 @@ class GCPAuthTestCase(unittest.TestCase):
|
|||
def test_validate_credentials_file(self):
|
||||
# TODO(supertom): Only dealing with p12 here, check the other states
|
||||
# of this function
|
||||
module = mock.MagicMock()
|
||||
module = FakeModule()
|
||||
with mock.patch("ansible.module_utils.gcp.open",
|
||||
mock.mock_open(read_data='foobar'), create=True) as m:
|
||||
# pem condition, warning is suppressed with the return_value
|
||||
credentials_file = '/foopath/pem.pem'
|
||||
is_valid = _validate_credentials_file(module,
|
||||
credentials_file=credentials_file,
|
||||
require_valid_json=False,
|
||||
check_libcloud=False)
|
||||
self.assertTrue(is_valid)
|
||||
with self.assertRaises(ValueError):
|
||||
_validate_credentials_file(module,
|
||||
credentials_file=credentials_file,
|
||||
require_valid_json=False,
|
||||
check_libcloud=False)
|
||||
|
||||
@mock.patch('ansible.module_utils.gcp._get_gcp_environ_var',
|
||||
side_effect=fake_get_gcp_environ_var)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue