  def testGetCredentialsFromInexistingProfileName(self, mock_azure_credentials):
    """Test that inexisting profile names will raise an error."""
    # If the profile name does not exist, should raise a ValueError
    mock_azure_credentials.return_value = None

    os.environ['AZURE_CREDENTIALS_PATH'] = os.path.join(
        os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(
            os.path.realpath(__file__))))), azure_mocks.JSON_FILE)

    with self.assertRaises(errors.CredentialsConfigurationError) as error:
      _, _ = common.GetCredentials(profile_name='foo')
      mock_azure_credentials.assert_not_called()
    self.assertEqual(
        'Profile name foo not found in credentials file {0:s}'.format(
            os.environ['AZURE_CREDENTIALS_PATH']), str(error.exception))
Test that inexisting profile names will raise an error.
tests/providers/azure/internal/test_common.py