Example #1
0
 def test_get_minio_auth(self):
     with mock.patch.dict('os.environ',
                          {'FUNCTION_CONFIG': StrUtils.utf8_to_base64_string(CONFIG_FILE_OK)},
                          clear=True):
         minio_auth = StorageConfig().get_auth_data_by_stg_type('MINIO')
         self.assertEqual(minio_auth.type, 'MINIO')
         self.assertEqual(minio_auth.get_credential('access_key'),
                          'test_minio_access')
         self.assertEqual(minio_auth.get_credential('secret_key'),
                          'test_minio_secret')
Example #2
0
 def test_get_onedata_auth(self):
     with mock.patch.dict('os.environ',
                          {'FUNCTION_CONFIG': StrUtils.utf8_to_base64_string(CONFIG_FILE_OK)},
                          clear=True):
         onedata_auth = StorageConfig().get_auth_data_by_stg_type('ONEDATA')
         self.assertEqual(onedata_auth.type, 'ONEDATA')
         self.assertEqual(onedata_auth.get_credential('oneprovider_host'),
                          'test_oneprovider.host')
         self.assertEqual(onedata_auth.get_credential('token'),
                          'test_onedata_token')
         self.assertEqual(onedata_auth.get_credential('space'),
                          'test_onedata_space')