def test_get_credentials_no_credentials_provided(self, mock_gcc, mock_gce): """Test if no user/profile is provided and no valid config file exists.""" auth = wc.get_credentials() assert auth is None assert not mock_gcc.called mock_gce.assert_called_once_with()
def test_get_credentials_from_env(self, mock_gce): auth = wc.get_credentials() assert auth == ('me', 'p@ss123') mock_gce.assert_called_once_with()
def test_get_credentials_from_config(self, mock_gcc, mock_gce): auth = wc.get_credentials(profile='unt') assert auth == ('me', 'p@ss123') mock_gcc.assert_called_once_with('unt') mock_gce.assert_called_once_with()
def test_get_credentials_from_getpass(self, mock_getpass): auth = wc.get_credentials(user='******') assert auth == ('me', 'p@ss123') mock_getpass.assert_called_once_with()