Exemplo n.º 1
0
 def test_valid_credentials(self):
     creds = httplib2_utils.load_service_account_credentials(
         'valid_creds.json', service_accounts_creds_root=DATA_DIR)
     self.assertIsInstance(creds, dict)
     self.assertIn('type', creds)
     self.assertIn('client_email', creds)
     self.assertIn('private_key', creds)
Exemplo n.º 2
0
 def test_valid_credentials(self):
   creds = httplib2_utils.load_service_account_credentials(
     'valid_creds.json',
     service_accounts_creds_root=DATA_DIR)
   self.assertIsInstance(creds, dict)
   self.assertIn('type', creds)
   self.assertIn('client_email', creds)
   self.assertIn('private_key', creds)
Exemplo n.º 3
0
 def test_file_not_found(self):
   with self.assertRaises(IOError):
     httplib2_utils.load_service_account_credentials(
       'this_file_should_not_exist.json',
       service_accounts_creds_root=DATA_DIR)
Exemplo n.º 4
0
 def test_malformed(self):
   with self.assertRaises(httplib2_utils.AuthError):
     httplib2_utils.load_service_account_credentials(
       'creds_malformed.json',
       service_accounts_creds_root=DATA_DIR)
Exemplo n.º 5
0
 def test_missing_private_key(self):
   with self.assertRaises(httplib2_utils.AuthError):
     httplib2_utils.load_service_account_credentials(
       'creds_missing_private_key.json',
       service_accounts_creds_root=DATA_DIR)
Exemplo n.º 6
0
 def test_missing_client_email(self):
   with self.assertRaises(infra_libs.AuthError):
     httplib2_utils.load_service_account_credentials(
       'creds_missing_client_email.json',
       service_accounts_creds_root=DATA_DIR)
Exemplo n.º 7
0
 def test_wrong_type(self):
   with self.assertRaises(infra_libs.AuthError):
     httplib2_utils.load_service_account_credentials(
       'creds_wrong_type.json',
       service_accounts_creds_root=DATA_DIR)
Exemplo n.º 8
0
 def test_file_not_found(self):
     with self.assertRaises(IOError):
         httplib2_utils.load_service_account_credentials(
             'this_file_should_not_exist.json',
             service_accounts_creds_root=DATA_DIR)
Exemplo n.º 9
0
 def test_malformed(self):
     with self.assertRaises(httplib2_utils.AuthError):
         httplib2_utils.load_service_account_credentials(
             'creds_malformed.json', service_accounts_creds_root=DATA_DIR)
Exemplo n.º 10
0
 def test_missing_private_key(self):
     with self.assertRaises(httplib2_utils.AuthError):
         httplib2_utils.load_service_account_credentials(
             'creds_missing_private_key.json',
             service_accounts_creds_root=DATA_DIR)
Exemplo n.º 11
0
 def test_missing_client_email(self):
   with self.assertRaises(infra_libs.AuthError):
     httplib2_utils.load_service_account_credentials(
       'creds_missing_client_email.json',
       service_accounts_creds_root=DATA_DIR)
Exemplo n.º 12
0
 def test_wrong_type(self):
   with self.assertRaises(infra_libs.AuthError):
     httplib2_utils.load_service_account_credentials(
       'creds_wrong_type.json',
       service_accounts_creds_root=DATA_DIR)